feat: add back cancel input on ctrl c

pull/60/head
sammyette 2021-06-08 21:00:01 -04:00
parent 86dbb97cae
commit be5ebd6ada
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5
3 changed files with 10 additions and 2 deletions

View File

@ -218,8 +218,7 @@ func HandleSignals() {
for range c { for range c {
if !running { if !running {
//readline.ReplaceLine("", 0) lr.ClearInput()
//readline.RefreshLine()
} }
} }
} }

5
rl.go
View File

@ -34,3 +34,8 @@ func (lr *LineReader) AddHistory(cmd string) {
readline.SaveHistory(homedir + "/.hilbish-history") readline.SaveHistory(homedir + "/.hilbish-history")
} }
func (lr *LineReader) ClearInput() {
readline.ReplaceLine("", 0)
readline.RefreshLine()
}

View File

@ -32,3 +32,7 @@ func (lr *LineReader) AddHistory(cmd string) {
return return
} }
func (lr *LineReader) ClearInput() {
return
}