mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-09-14 06:30:45 +00:00
system/cu: Let remote machine handle special character except Ctrl-C
Let remote machine handle special character except Ctrl-C, make cu's behavior more close to linux/bsd system. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
parent
b3cfcee47d
commit
4079f6d613
1 changed files with 5 additions and 13 deletions
|
|
@ -182,10 +182,6 @@ static int set_termios(int fd, int nocrlf)
|
|||
tio.c_oflag |= ONLCR;
|
||||
}
|
||||
|
||||
/* disable echo if it's enabled to avoid double input character */
|
||||
|
||||
tio.c_iflag &= ~ECHO;
|
||||
|
||||
ret = tcsetattr(fd, TCSANOW, &tio);
|
||||
if (ret)
|
||||
{
|
||||
|
|
@ -194,19 +190,15 @@ static int set_termios(int fd, int nocrlf)
|
|||
goto errout;
|
||||
}
|
||||
|
||||
/* for tty stdout force enable or disable \n -> \r\n conversion */
|
||||
/* Let the remote machine to handle all crlf/echo except Ctrl-C */
|
||||
|
||||
if (fd_std_tty >= 0)
|
||||
{
|
||||
tio = g_tio_std;
|
||||
if (nocrlf == 0)
|
||||
{
|
||||
tio.c_oflag |= ONLCR;
|
||||
}
|
||||
else
|
||||
{
|
||||
tio.c_oflag &= ~ONLCR;
|
||||
}
|
||||
|
||||
tio.c_iflag = 0;
|
||||
tio.c_oflag = 0;
|
||||
tio.c_lflag &= ~ECHO;
|
||||
|
||||
ret = tcsetattr(fd_std_tty, TCSANOW, &tio);
|
||||
if (ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue