From 3ed2a91cbcb26a59b288cc5dc4e378b71195cd8e Mon Sep 17 00:00:00 2001 From: nea Date: Sat, 4 Feb 2023 14:03:55 +0100 Subject: [PATCH] Save cursor position before printing image to fix text being cut off --- utils/printing.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/printing.go b/utils/printing.go index c6f4320..02eb34f 100644 --- a/utils/printing.go +++ b/utils/printing.go @@ -229,11 +229,12 @@ func CutePrintEnd() { CuteNewLine() } if usepng { + fmt.Print("\x1b7") fmt.Printf("\x1b[%dA", logoIndex) fmt.Printf("\x1b]1337;File=inline=1;width=%d;height=%d:", pngWidth, pngHeight) enc := base64.NewEncoder(base64.StdEncoding, os.Stdout) enc.Write(images.DistroImages[getcustomizeddistro()]) enc.Close() - fmt.Println("\a") + fmt.Print("\a\x1b8") } }