xiaoxiang781216 commented on code in PR #2769:
URL: https://github.com/apache/nuttx-apps/pull/2769#discussion_r1815895453


##########
system/termcurses/tcurses_vt100.c:
##########
@@ -1507,6 +1507,14 @@ FAR struct termcurses_s *tcurses_vt100_initialize(int 
in_fd, int out_fd)
                   cfg.c_lflag &= ~ECHO;
                   tcsetattr(priv->in_fd, TCSANOW, &cfg);
                 }
+
+              /* If ICANON enabled, disable it */
+              
+              if (cfg.c_lflag & ICANON)

Review Comment:
   let's merge with block line 1505-1509:
   ```
   if (cfg.c_lflag & (ECHO | ICANON))
     {
       cfg.c_lflag &= ~(ECHO | ICANON);
       tcsetattr(priv->in_fd, TCSANOW, &cfg);
     }
   ```



##########
system/termcurses/tcurses_vt100.c:
##########
@@ -1546,10 +1554,19 @@ static int tcurses_vt100_terminate(FAR struct 
termcurses_s *dev)
 
       if (isatty(priv->in_fd))
         {
-          if (tcgetattr(priv->in_fd, &cfg) == 0 && priv->lflag & ECHO)

Review Comment:
   ```
             if ((priv->lflag & (ECHO | ICANON)) && tcgetattr(priv->in_fd, 
&cfg) == 0)
               {
                 cfg.c_lflag = priv->lflag;
                 tcsetattr(priv->in_fd, TCSANOW, &cfg);
              }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to