2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-03-31 18:53:22 +00:00

fix: check if interactive *and* input starts with space to determine if to add to history

This commit is contained in:
TorchedSammy 2022-03-13 12:51:27 -04:00
parent dc53eef829
commit b05cb30ed7
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD

View File

@ -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")