Browse Source

Allow to generate signals when termios is in raw mode.

David Calavera 12 years ago
parent
commit
23dc52f528
3 changed files with 2 additions and 9 deletions
  1. 0 7
      commands.go
  2. 1 1
      term/termios_darwin.go
  3. 1 1
      term/termios_linux.go

+ 0 - 7
commands.go

@@ -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)

+ 1 - 1
term/termios_darwin.go

@@ -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

+ 1 - 1
term/termios_linux.go

@@ -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