Unverified Commit 7a1b37ac authored by Bruce MacDonald's avatar Bruce MacDonald Committed by GitHub
Browse files

os specific ctrl-z (#1420)

parent 5d4d2e2c
......@@ -192,14 +192,7 @@ func (i *Instance) Readline() (string, error) {
case CharCtrlW:
buf.DeleteWord()
case CharCtrlZ:
if err := UnsetRawMode(fd, termios); err != nil {
return "", err
}
syscall.Kill(0, syscall.SIGSTOP)
// on resume...
return "", nil
return handleCharCtrlZ(fd, termios)
case CharEnter:
output := buf.String()
if output != "" {
......
//go:build !windows
package readline
import (
"syscall"
)
func handleCharCtrlZ(fd int, termios *Termios) (string, error) {
if err := UnsetRawMode(fd, termios); err != nil {
return "", err
}
syscall.Kill(0, syscall.SIGSTOP)
// on resume...
return "", nil
}
package readline
func handleCharCtrlZ(fd int, state *State) (string, error) {
// not supported
return "", nil
}
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