mirror of https://github.com/Hilbis/Hilbish
fix: put input in history instead of resolved input ran by hilbish
ive fixed this like 3 times and regressed itctrl-delete
parent
9ce861b080
commit
ee4d97ff9a
16
exec.go
16
exec.go
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue