From 3e37ebf85a82741bafa66b3bf37c62aec102cbc0 Mon Sep 17 00:00:00 2001 From: Andrey Petrov Date: Sun, 21 Apr 2019 16:48:12 -0400 Subject: [PATCH] sshd/terminal: Undo emoji offset bugfix Introduced another bug: #316 --- sshd/terminal/terminal.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sshd/terminal/terminal.go b/sshd/terminal/terminal.go index 01cb3467..690937e6 100644 --- a/sshd/terminal/terminal.go +++ b/sshd/terminal/terminal.go @@ -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.