From 8d40179a73fe5942707cd43f9c0463dee53eedd8 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Sat, 10 Dec 2022 17:27:42 -0400 Subject: [PATCH] fix(readline): dont do anything if length of input rune slice is 0 this fixes an issue when readline splits multiline input. sometimes, the multiple lines just end up being "stray?" inputs of enter plus a newline. this can happen if a user attempts to prefire the enter key while a command is running, for example --- readline/readline.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readline/readline.go b/readline/readline.go index dc8407c..f1d6c96 100644 --- a/readline/readline.go +++ b/readline/readline.go @@ -546,6 +546,10 @@ func (rl *Instance) Readline() (string, error) { // entry readline is currently configured for and then update the line entries // accordingly. func (rl *Instance) editorInput(r []rune) { + if len(r) == 0 { + return + } + switch rl.modeViMode { case VimKeys: rl.vi(r[0])