[Breaking change] Default behavior of pty

2023-03-19 Thread Huang Qi
Hi, all:

I have a PR (drivers/pty: Echo input by default by no1wudi ・ Pull Request #8846 
・ apache/nuttx (github.com))  which 
align the pty behavior to linux/bsd,

Also fix the ECHO issue with microadb after 
#8691

adb shell will echo normally with this patch.

Telnet and adb are tested, for other usage, maybe should disable these behavior 
munally by termios as other OS.

BR


Default behavior of cu

2023-03-13 Thread Huang Qi
Hi all,

There excatly are some issues after echo input in driver 
(https://github.com/apache/nuttx/pull/8691), the default behavior of cu is one 
of them should be discussed.
[https://opengraph.githubassets.com/d9287525ac4414548917840a0f06e871d6208b7ef78597353c79478a6ee0199f/apache/nuttx/pull/8691]
drivers/serial: Echo input in driver layer by no1wudi · Pull Request #8691 · 
apache/nuttx
Summary Works with apache/nuttx-apps#1608 Impact nsh Testing nsh and telnet
github.com

In current master, cu will let local machine handle the echo and CR/LF 
convertion by default, a major usage of cu (for me) is to connect to a AMP core 
(running another NuttX ) over uart_rpmsg, now the uart_rpmsg driver disabled 
its echo to avoid double the input (from the local core and AMP core).

I see some implementation of cu (like BSD) will disable the echo and CR/LF 
convertion and let remote machine to handle them.

I prefer to follow the BSD way, is there any side effect for you? Or do you 
have any suggetions?

BR,
Qi


Re: Changes in Common Line Editor

2023-03-10 Thread Huang Qi
> There are bandaid fixes going in that try to recover from the primary bad 
> fix.  That is not > good.  That is only making things worse.  We need to fix 
> the root cause of the problem
> no just change the behavior of individual apps to hide the problem.  The root 
> cause is
> that the serial driver is echoing things it should not and is not smart 
> enough to know
> what it should not echo.

In fact, cle has its own issue, it will send a query cursor first, and wait for 
the reply from serial port.

If you power up your device first and attach it to PC by serial port later (the 
PC will miss the cursor query command), the cle will hang in here unless you 
press any key ten more times.

And in this process, no any info will inform user.

This patch in thread fixed this behavior, and also fix the issue similar with 
above (but due to driver instead of outside reason).


RE: [Breaking change] Echo character by serial driver

2023-03-10 Thread Huang Qi
> That 1Kb number seems large to me.  Most of that is in the lower-half,
> UART driver, right?  If so then the size would vary dramatically from
> chip-to-chip.

I prefer to select it by Kconfig, most morden platforms doesn't make sense for 
1Kb but still many chips in source tree with very small flash size.

BTW, for this thread, I think we can try to optimize the new approach about 
ECHO and fix all issue found.

If it's not possible or not the right way, let's revert the change.

What's your opinion?

On 3/10/2023 7:44 PM, Huang Qi wrote:
> >>  The ECHO behavior can be disabled ONLY if TERMIOS are enabled.
> >>  TERIMIOS is now required by POSIX and, further, if TERMIOS is not
> >>  system, many features are now broken.  Like hiding the password when
> >>  logging into NSH.
> > Yes maybe we should select TERMIOS if some features really need it ?
> Most apps don't need it, only
> > termcurse/nsh login rely on it now in my known.
>
> > The those Kconfig files should select TERMIOS_SERIAL, right?
>
> Yes, this is a chioce, or we can make TERMIOS enabled forcely, but
> will cause a extra 1KB overhead for all target.
>
That 1Kb number seems large to me.  Most of that is in the lower-half,
UART driver, right?  If so then the size would vary dramatically from
chip-to-chip.


As a percentage growth, I suppose even 1Kb is not so large.  Probably
less then 2%


RE: [Breaking change] Echo character by serial driver

2023-03-10 Thread Huang Qi
>>   The ECHO behavior can be disabled ONLY if TERMIOS are enabled.
>>   TERIMIOS is now required by POSIX and, further, if TERMIOS is not
>>   system, many features are now broken.  Like hiding the password when
>>   logging into NSH.
> Yes maybe we should select TERMIOS if some features really need it ? Most 
> apps don't need it, only
> termcurse/nsh login rely on it now in my known.

> The those Kconfig files should select TERMIOS_SERIAL, right?

Yes, this is a chioce, or we can make TERMIOS enabled forcely, but will cause a 
extra 1KB overhead for all target.


发件人: Gregory Nutt 
发送时间: 2023年3月11日 09:33
收件人: Qi Huang 
主题: Re: [Breaking change] Echo character by serial driver


>>   The ECHO behavior can be disabled ONLY if TERMIOS are enabled.
>>   TERIMIOS is now required by POSIX and, further, if TERMIOS is not
>>   system, many features are now broken.  Like hiding the password when
>>   logging into NSH.
> Yes maybe we should select TERMIOS if some features really need it ? Most 
> apps don't need it, only
> termcurse/nsh login rely on it now in my known.
The those Kconfig files should select TERMIOS_SERIAL, right?