Skip to content

Commit

Permalink
fix(vt): update cursor position after line break
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Nov 17, 2024
1 parent fa514af commit 171d9d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vt/utf8.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 171d9d2

Please sign in to comment.