1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Allow to generate signals when termios is in raw mode.

This commit is contained in:
David Calavera 2013-07-27 09:13:02 -07:00
parent c3154fdf4d
commit 23dc52f528
3 changed files with 2 additions and 9 deletions

View file

@ -333,13 +333,6 @@ func (cli *DockerCli) CmdLogin(args ...string) error {
authconfig = auth.AuthConfig{}
}
sigchan := make(chan os.Signal, 1)
signal.Notify(sigchan, syscall.SIGINT, syscall.SIGTERM)
go func() {
<-sigchan
os.Exit(1)
}()
if *flUsername == "" {
promptDefault("Username", authconfig.Username)
username = readAndEchoString(cli.in, cli.out)

View file

@ -44,7 +44,7 @@ func MakeRaw(fd uintptr) (*State, error) {
newState.Iflag &^= (ISTRIP | INLCR | IGNCR | IXON | IXOFF)
newState.Iflag |= ICRNL
newState.Oflag |= ONLCR
newState.Lflag &^= (ECHO | ICANON | ISIG)
newState.Lflag &^= (ECHO | ICANON)
if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(setTermios), uintptr(unsafe.Pointer(&newState))); err != 0 {
return nil, err

View file

@ -33,7 +33,7 @@ func MakeRaw(fd uintptr) (*State, error) {
newState.Iflag &^= (syscall.IGNBRK | syscall.BRKINT | syscall.PARMRK | syscall.ISTRIP | syscall.INLCR | syscall.IGNCR | syscall.ICRNL | syscall.IXON)
newState.Oflag &^= syscall.OPOST
newState.Lflag &^= (syscall.ECHO | syscall.ECHONL | syscall.ICANON | syscall.ISIG | syscall.IEXTEN)
newState.Lflag &^= (syscall.ECHO | syscall.ECHONL | syscall.ICANON | syscall.IEXTEN)
newState.Cflag &^= (syscall.CSIZE | syscall.PARENB)
newState.Cflag |= syscall.CS8