Unverified Commit b3f6c659 authored by Michael Yang's avatar Michael Yang Committed by GitHub
Browse files

Merge pull request #1349 from jmorganca/mxyng/ctrl-z

handle ctrl+z
parents cedae0d1 88620e98
...@@ -191,6 +191,15 @@ func (i *Instance) Readline() (string, error) { ...@@ -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 != "" {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment