From b05cb30ed7faf0de718c04e8d0b85b4e4ae185f7 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Sun, 13 Mar 2022 12:51:27 -0400 Subject: [PATCH] fix: check if interactive *and* input starts with space to determine if to add to history --- exec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.go b/exec.go index e3d5885..f1b7c88 100644 --- a/exec.go +++ b/exec.go @@ -244,7 +244,7 @@ func splitInput(input string) ([]string, string) { func cmdFinish(code uint8, cmdstr, oldInput string) { // if input has space at the beginning, dont put in history - if !strings.HasPrefix(oldInput, " ") || interactive { + if interactive && !strings.HasPrefix(oldInput, " ") { handleHistory(strings.TrimSpace(oldInput)) } util.SetField(l, hshMod, "exitCode", lua.LNumber(code), "Exit code of last exected command")