Isn't the default setting of ECHO disabled?  My understanding is the
ECHO is always /disabled /unless it is specifically /enabled /in the
TERMIOS settings.

No, it depends on isconsole:
https://github.com/apache/nuttx/blob/master/drivers/serial/serial.c#L1303-L1308
https://github.com/apache/nuttx/blob/master/drivers/serial/serial.c#L1821-L1840
https://github.com/apache/nuttx/blob/master/drivers/serial/serial.c#L339-L344
All terminal special handling(\r\n<->\n, ECHO CRTL+C) is activated if
isconsole equals true.
And all serial ports designed for shell set isconsole=true statically.

It would be a good thing to eliminate isconsole.  Any tty device should be capable of being a console.

Has anyone tests the USB serial drivers?  Does the console still work over USB?

The first and last deal with CR-LF expansion as I mentioned.  The second is a little different.  This is 1) enabling signal handling to support Ctrl-C behavior and enabling CR-LF expansion.   Oddly, it also enables echo.  Those, of course, never did anything in the past:  CR-FL expansion was controlled by the isonsole flag and t/*here was no implementation of ECHO before 68384e9db42*/.  So, yes, you are right about some of that.

Those "odd behaviors", including select ECHO where added by Huanq Qi in 3e41bd8b359 and 68384e9db42 and never existed in the original code.   It is part of the disastrous implementation of ECHO and never should have been there at all.

As I said originally, isconsole was only added as a kludge to get CR-LF.


Reply via email to