* commit 'cced7693520d6376fe25fa4698c2b5ec7d6364a0': Disable CR/LF translation for adb interactive shell.
This commit is contained in:
commit
08d719d25e
1 changed files with 10 additions and 14 deletions
|
@ -256,29 +256,25 @@ void stdin_raw_restore(int fd);
|
|||
}
|
||||
|
||||
#else
|
||||
static struct termios tio_save;
|
||||
static termios g_saved_terminal_state;
|
||||
|
||||
static void stdin_raw_init(int fd)
|
||||
{
|
||||
struct termios tio;
|
||||
static void stdin_raw_init(int fd) {
|
||||
if (tcgetattr(fd, &g_saved_terminal_state)) return;
|
||||
|
||||
if(tcgetattr(fd, &tio)) return;
|
||||
if(tcgetattr(fd, &tio_save)) return;
|
||||
termios tio;
|
||||
if (tcgetattr(fd, &tio)) return;
|
||||
|
||||
tio.c_lflag = 0; /* disable CANON, ECHO*, etc */
|
||||
cfmakeraw(&tio);
|
||||
|
||||
/* no timeout but request at least one character per read */
|
||||
// No timeout but request at least one character per read.
|
||||
tio.c_cc[VTIME] = 0;
|
||||
tio.c_cc[VMIN] = 1;
|
||||
|
||||
tcsetattr(fd, TCSANOW, &tio);
|
||||
tcflush(fd, TCIFLUSH);
|
||||
tcsetattr(fd, TCSAFLUSH, &tio);
|
||||
}
|
||||
|
||||
static void stdin_raw_restore(int fd)
|
||||
{
|
||||
tcsetattr(fd, TCSANOW, &tio_save);
|
||||
tcflush(fd, TCIFLUSH);
|
||||
static void stdin_raw_restore(int fd) {
|
||||
tcsetattr(fd, TCSAFLUSH, &g_saved_terminal_state);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue