mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-07-15 04:45:51 +08:00
termcurses: Disable ICANON for serial driver. That was broken VI editor.
The ICANON flag broken VI key input, so disable it. Signed-off-by: Leo Chung <gewalalb@gmail.com>
This commit is contained in:
parent
41bc4f7873
commit
c0e04b0251
@ -1500,11 +1500,11 @@ FAR struct termcurses_s *tcurses_vt100_initialize(int in_fd, int out_fd)
|
|||||||
|
|
||||||
priv->lflag = cfg.c_lflag;
|
priv->lflag = cfg.c_lflag;
|
||||||
|
|
||||||
/* If ECHO enabled, disable it */
|
/* If ECHO and ICANON enabled, disable it */
|
||||||
|
|
||||||
if (cfg.c_lflag & ECHO)
|
if (cfg.c_lflag & (ECHO | ICANON))
|
||||||
{
|
{
|
||||||
cfg.c_lflag &= ~ECHO;
|
cfg.c_lflag &= ~(ECHO | ICANON);
|
||||||
tcsetattr(priv->in_fd, TCSANOW, &cfg);
|
tcsetattr(priv->in_fd, TCSANOW, &cfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1546,9 +1546,10 @@ static int tcurses_vt100_terminate(FAR struct termcurses_s *dev)
|
|||||||
|
|
||||||
if (isatty(priv->in_fd))
|
if (isatty(priv->in_fd))
|
||||||
{
|
{
|
||||||
if (tcgetattr(priv->in_fd, &cfg) == 0 && priv->lflag & ECHO)
|
if ((priv->lflag & (ECHO | ICANON))
|
||||||
|
&& tcgetattr(priv->in_fd, &cfg) == 0)
|
||||||
{
|
{
|
||||||
cfg.c_lflag |= ECHO;
|
cfg.c_lflag = priv->lflag;
|
||||||
tcsetattr(priv->in_fd, TCSANOW, &cfg);
|
tcsetattr(priv->in_fd, TCSANOW, &cfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user