handle ctrl+z
This commit is contained in:
parent
cedae0d17a
commit
88620e983a
1 changed files with 9 additions and 0 deletions
|
@ -191,6 +191,15 @@ func (i *Instance) Readline() (string, error) {
|
||||||
buf.ClearScreen()
|
buf.ClearScreen()
|
||||||
case CharCtrlW:
|
case CharCtrlW:
|
||||||
buf.DeleteWord()
|
buf.DeleteWord()
|
||||||
|
case CharCtrlZ:
|
||||||
|
if err := UnsetRawMode(fd, termios); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
syscall.Kill(0, syscall.SIGSTOP)
|
||||||
|
|
||||||
|
// on resume...
|
||||||
|
return "", nil
|
||||||
case CharEnter:
|
case CharEnter:
|
||||||
output := buf.String()
|
output := buf.String()
|
||||||
if output != "" {
|
if output != "" {
|
||||||
|
|
Loading…
Reference in a new issue