From 853dfa369f3b64aaf10ec5ce2a1fa1cc27489b84 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Mon, 7 Mar 2022 19:10:21 -0400 Subject: [PATCH] fix: add user input to history instead of hilbish expanded (closes #103) --- exec.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exec.go b/exec.go index 8c89dee..e3d5885 100644 --- a/exec.go +++ b/exec.go @@ -9,7 +9,7 @@ import ( "time" "hilbish/util" - + "github.com/yuin/gopher-lua" "mvdan.cc/sh/v3/shell" //"github.com/yuin/gopher-lua/parse" @@ -245,7 +245,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 { - handleHistory(cmdstr) + handleHistory(strings.TrimSpace(oldInput)) } util.SetField(l, hshMod, "exitCode", lua.LNumber(code), "Exit code of last exected command") hooks.Em.Emit("command.exit", code, cmdstr)