readline_unix.go 291 Bytes
Newer Older
mashun1's avatar
v1  
mashun1 committed
1
2
3
4
5
6
7
8
//go:build !windows

package readline

import (
	"syscall"
)

xuxzh1's avatar
init  
xuxzh1 committed
9
func handleCharCtrlZ(fd uintptr, termios any) (string, error) {
mashun1's avatar
v1  
mashun1 committed
10
11
12
13
14
15
16
17
18
19
	t := termios.(*Termios)
	if err := UnsetRawMode(fd, t); err != nil {
		return "", err
	}

	_ = syscall.Kill(0, syscall.SIGSTOP)

	// on resume...
	return "", nil
}