system/cu: Disable echo if it's enabled to avoid double input character

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2023-03-07 14:37:26 +08:00 committed by Alin Jerpelea
parent 4a9752ed3d
commit 96cd66cf51

View File

@ -179,6 +179,10 @@ static int set_termios(int fd, int rate, enum parity_mode parity,
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)
{