From 171d9d2771bf5ccc54d58883516c350fc4e9d732 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Sun, 17 Nov 2024 14:37:45 -0500 Subject: [PATCH] fix(vt): update cursor position after line break --- vt/utf8.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vt/utf8.go b/vt/utf8.go index 4fd478c5..a706f60c 100644 --- a/vt/utf8.go +++ b/vt/utf8.go @@ -22,18 +22,19 @@ func (t *Terminal) handleUtf8(seq ansi.Sequence) { x, y := t.scr.CursorPosition() if t.atPhantom || x+width > t.scr.Width() { - x = 0 // moves cursor down similar to [Terminal.linefeed] except it doesn't // respects [ansi.LNM] mode. // This will rest the phantom state i.e. pending wrap state. t.index() + _, y = t.scr.CursorPosition() + x = 0 } // Handle character set mappings if len(content) == 1 { var charset CharSet c := content[0] - if t.gsingle > 0 && t.gsingle < 4 { + if t.gsingle > 1 && t.gsingle < 4 { charset = t.charsets[t.gsingle] t.gsingle = 0 } else if c < 128 {