ollama/readline/readline_unix.go

20 lines
291 B
Go
Raw Normal View History

2023-12-11 23:48:14 +08:00
//go:build !windows
package readline
import (
"syscall"
)
2024-05-23 00:00:38 +08:00
func handleCharCtrlZ(fd uintptr, termios any) (string, error) {
t := termios.(*Termios)
if err := UnsetRawMode(fd, t); err != nil {
2023-12-11 23:48:14 +08:00
return "", err
}
2023-12-16 06:07:34 +08:00
_ = syscall.Kill(0, syscall.SIGSTOP)
2023-12-11 23:48:14 +08:00
// on resume...
return "", nil
}