readline_unix.go 291 B

1234567891011121314151617181920
  1. //go:build !windows
  2. package readline
  3. import (
  4. "syscall"
  5. )
  6. func handleCharCtrlZ(fd uintptr, termios any) (string, error) {
  7. t := termios.(*Termios)
  8. if err := UnsetRawMode(fd, t); err != nil {
  9. return "", err
  10. }
  11. _ = syscall.Kill(0, syscall.SIGSTOP)
  12. // on resume...
  13. return "", nil
  14. }