diff --git a/main.go b/main.go index d537cf9..8330175 100644 --- a/main.go +++ b/main.go @@ -200,7 +200,6 @@ input: } } } - running = true HandleHistory(input) RunInput(input) @@ -266,12 +265,12 @@ func HandleSignals() { switch s { case os.Interrupt: hooks.Em.Emit("signals.sigint") - if !running { + if !running && interactive { lr.ClearInput() } case syscall.SIGWINCH: hooks.Em.Emit("signals.resize") - if !running { + if !running && interactive { lr.Resize() } } diff --git a/shell.go b/shell.go index 11f1f2f..cae6c23 100644 --- a/shell.go +++ b/shell.go @@ -15,6 +15,7 @@ import ( ) func RunInput(input string) { + running = true cmdArgs, cmdString := splitInput(input) // If alias was found, use command alias