]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
use raw settings of ssh for pty 982/head
authorChristian Brauner <christian.brauner@mailbox.org>
Tue, 19 Apr 2016 13:17:19 +0000 (15:17 +0200)
committerChristian Brauner <christian.brauner@mailbox.org>
Tue, 19 Apr 2016 13:17:19 +0000 (15:17 +0200)
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
src/lxc/console.c

index c6f6adc616b5ee38f9717fae82bd5a4f421c1293..6d335cade96f080abe4a87bd0c566cbb751a6823 100644 (file)
@@ -260,16 +260,21 @@ int lxc_setup_tios(int fd, struct termios *oldtios)
 
        newtios = *oldtios;
 
-       /* Remove the echo characters and signal reception, the echo
-        * will be done with master proxying */
-       newtios.c_iflag &= ~(IGNBRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IXANY|IXOFF);
-       newtios.c_iflag &= BRKINT;
-       newtios.c_lflag &= ~(ECHO|ICANON|ISIG|IEXTEN|ECHOE|ECHOK|ECHONL);
+       /* We use the same settings that ssh does. */
+       newtios.c_iflag |= IGNPAR;
+       newtios.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF);
+#ifdef IUCLC
+       newtios.c_iflag &= ~IUCLC;
+#endif
+       newtios.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL);
+#ifdef IEXTEN
+       newtios.c_lflag &= ~IEXTEN;
+#endif
        newtios.c_oflag &= ~OPOST;
        newtios.c_cc[VMIN] = 1;
        newtios.c_cc[VTIME] = 0;
 
-       /* Set new attributes */
+       /* Set new attributes. */
        if (tcsetattr(fd, TCSAFLUSH, &newtios)) {
                ERROR("failed to set new terminal settings");
                return -1;