fix: put input in history instead of resolved input ran by hilbish

ive fixed this like 3 times and regressed it
ctrl-delete
TorchedSammy 2022-04-04 21:21:46 -04:00
parent 9ce861b080
commit ee4d97ff9a
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 8 additions and 8 deletions

16
exec.go
View File

@ -37,37 +37,37 @@ func runInput(input string, priv bool) {
case "hybrid": case "hybrid":
_, err := handleLua(cmdString) _, err := handleLua(cmdString)
if err == nil { if err == nil {
cmdFinish(0, cmdString, priv) cmdFinish(0, input, priv)
return return
} }
exitCode, err := handleSh(cmdString) exitCode, err := handleSh(cmdString)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
} }
cmdFinish(exitCode, cmdString, priv) cmdFinish(exitCode, input, priv)
case "hybridRev": case "hybridRev":
_, err := handleSh(cmdString) _, err := handleSh(cmdString)
if err == nil { if err == nil {
cmdFinish(0, cmdString, priv) cmdFinish(0, input, priv)
return return
} }
exitCode, err := handleLua(cmdString) exitCode, err := handleLua(cmdString)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
} }
cmdFinish(exitCode, cmdString, priv) cmdFinish(exitCode, input, priv)
case "lua": case "lua":
exitCode, err := handleLua(cmdString) exitCode, err := handleLua(cmdString)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
} }
cmdFinish(exitCode, cmdString, priv) cmdFinish(exitCode, input, priv)
case "sh": case "sh":
exitCode, err := handleSh(cmdString) exitCode, err := handleSh(cmdString)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
} }
cmdFinish(exitCode, cmdString, priv) cmdFinish(exitCode, input, priv)
} }
} else { } else {
// can only be a string or function so // can only be a string or function so
@ -75,7 +75,7 @@ func runInput(input string, priv bool) {
err := rt.Call(l.MainThread(), runnerMode, []rt.Value{rt.StringValue(cmdString)}, term) err := rt.Call(l.MainThread(), runnerMode, []rt.Value{rt.StringValue(cmdString)}, term)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
cmdFinish(124, cmdString, priv) cmdFinish(124, input, priv)
return return
} }
@ -90,7 +90,7 @@ func runInput(input string, priv bool) {
if runErr != rt.NilValue { if runErr != rt.NilValue {
fmt.Fprintln(os.Stderr, runErr) fmt.Fprintln(os.Stderr, runErr)
} }
cmdFinish(exitCode, cmdString, priv) cmdFinish(exitCode, input, priv)
} }
} }