[lxc-devel] [lxc/master] Switch console pty to raw mode.

LynxChaus on Github lxc-bot at linuxcontainers.org
Mon Apr 18 16:17:24 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 420 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160418/0e3a4697/attachment.bin>
-------------- next part --------------
From d3893399703389e69da39bc01d76fa21e228bd80 Mon Sep 17 00:00:00 2001
From: "Andrey Jr. Melnikov" <temnota.am at gmail.com>
Date: Mon, 18 Apr 2016 19:16:08 +0300
Subject: [PATCH] Switch console pty to raw mode. Without this some
 ncurses-based programs behave incorrectly

Signed-off-by: Andrey Jr. Melnikov <temnota.am at gmail.com>
---
 src/lxc/console.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lxc/console.c b/src/lxc/console.c
index a346377..c6f6adc 100644
--- a/src/lxc/console.c
+++ b/src/lxc/console.c
@@ -262,9 +262,10 @@ int lxc_setup_tios(int fd, struct termios *oldtios)
 
 	/* Remove the echo characters and signal reception, the echo
 	 * will be done with master proxying */
-	newtios.c_iflag &= ~IGNBRK;
+	newtios.c_iflag &= ~(IGNBRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IXANY|IXOFF);
 	newtios.c_iflag &= BRKINT;
-	newtios.c_lflag &= ~(ECHO|ICANON|ISIG);
+	newtios.c_lflag &= ~(ECHO|ICANON|ISIG|IEXTEN|ECHOE|ECHOK|ECHONL);
+	newtios.c_oflag &= ~OPOST;
 	newtios.c_cc[VMIN] = 1;
 	newtios.c_cc[VTIME] = 0;
 


More information about the lxc-devel mailing list