diff options
Diffstat (limited to 'core/org.eclipse.cdt.core.macosx/library/openpty.c')
-rw-r--r-- | core/org.eclipse.cdt.core.macosx/library/openpty.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.macosx/library/openpty.c b/core/org.eclipse.cdt.core.macosx/library/openpty.c index b1660a13b78..d6f6263b674 100644 --- a/core/org.eclipse.cdt.core.macosx/library/openpty.c +++ b/core/org.eclipse.cdt.core.macosx/library/openpty.c @@ -13,6 +13,7 @@ #include <stdio.h> #include <string.h> #include <grp.h> +#include <termios.h> #include <stdlib.h> @@ -102,3 +103,21 @@ ptys_open(int fdm, char * pts_name) } return fds; } + +void +set_noecho(int fd) +{ + struct termios stermios; + if (tcgetattr(fd, &stermios) < 0) { + return ; + } + + /* turn off echo */ + stermios.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL); + /* Turn off the NL to CR/NL mapping ou output. */ + /*stermios.c_oflag &= ~(ONLCR);*/ + + stermios.c_iflag |= (IGNCR); + + tcsetattr(fd, TCSANOW, &stermios); +} |