I imagine that this is occurring because readline also echos the input:


https://github.com/apache/nuttx-apps/blob/master/system/readline/readline_common.c#L644

The low-level serial driver should not echo just because /isconsole /is
true.  Console echo is always handled by the application.  I would say
that that is a bug.

 From the spec:
https://pubs.opengroup.org/onlinepubs/7908799/xsh/termios.h.html
the serial driver should echo the char if ECHO is enabled. Since NuttX
doesn't follow the spec, it makes many POSIX compliant interactive shells
doesn't work very well.
We have to make the breaking change to fix the wrong initial implementation.

I still seems like the isconsole does not belong in the conditional:

https://github.com/apache/nuttx/commit/68384e9db42e254b2cf6720bc3380aebdd2b298c

          if (dev->isconsole
#ifdef CONFIG_SERIAL_TERMIOS
              || (dev->tc_iflag & ECHO)
#endif
             )
            {

Currently:

 893           if (
 894 #ifdef CONFIG_SERIAL_TERMIOS
 895               dev->tc_iflag & ECHO
 896 #else
 897               dev->isconsole
 898 #endif
 899              )
 900             {

If CONFIG_SERIAL_TERMIOS is not set then shouldn't the entire 'if ' condition should be removed?

Reply via email to