mirror of https://github.com/Hilbis/Hilbish
fix: check if interactive when handling signals
parent
2a71fb0075
commit
6ac4aa50b3
5
main.go
5
main.go
|
@ -200,7 +200,6 @@ input:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
running = true
|
|
||||||
HandleHistory(input)
|
HandleHistory(input)
|
||||||
RunInput(input)
|
RunInput(input)
|
||||||
|
|
||||||
|
@ -266,12 +265,12 @@ func HandleSignals() {
|
||||||
switch s {
|
switch s {
|
||||||
case os.Interrupt:
|
case os.Interrupt:
|
||||||
hooks.Em.Emit("signals.sigint")
|
hooks.Em.Emit("signals.sigint")
|
||||||
if !running {
|
if !running && interactive {
|
||||||
lr.ClearInput()
|
lr.ClearInput()
|
||||||
}
|
}
|
||||||
case syscall.SIGWINCH:
|
case syscall.SIGWINCH:
|
||||||
hooks.Em.Emit("signals.resize")
|
hooks.Em.Emit("signals.resize")
|
||||||
if !running {
|
if !running && interactive {
|
||||||
lr.Resize()
|
lr.Resize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue