Skip to content

Commit

Permalink
sshd/terminal: Undo emoji offset bugfix
Browse files Browse the repository at this point in the history
Introduced another bug: #316
  • Loading branch information
shazow committed Apr 21, 2019
1 parent 5949f97 commit 3e37ebf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sshd/terminal/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,9 @@ func (t *Terminal) handleKey(key rune) (line string, ok bool) {
keyEscape, '[', 'J',
}
t.queue(reset)
// We're still technically on the same line. If we don't offset the
// cursorX, then the fresh prompt could be rendered in the wrong
// position.
t.cursorX += len(reset)
// FIXME: This causes a slice out of bounds panic, but without it we
// get an offset with emojis
// t.cursorX += len(reset)
} else {
// Pushing the line up resets the cursor to 0,0 and we render a
// fresh prompt.
Expand Down

0 comments on commit 3e37ebf

Please sign in to comment.