I think I should give a simple brief of questions mentioned:

1.  How to handle so many vt100 commands ?


There aren't many vt100 commands actually used,  current implementation can 
meet nearly all requirment in apps (only pdcurse need test, I'll have a test 
soon). If we really need to handle all vt100 command someday, we can add a line 
driver on top of serial driver like linux does.


2. Does CLE break?


CLE and termcurse (VI) works fine, but in pdcurse, console was set to raw mode 
and ECHO restored after exit to nsh.

CLE meet a issue on specific hardware due to driver, but have a fix 
https://github.com/apache/nuttx-apps/pull/1650 , it should works, wait for the 
feedback.


3. TERMIOS


In my test now, only termcurse rely on raw mode (maybe another is pdcurse), so 
the must set raw mode for them.

Enable TERMIOS will take about more ~840 bytes text and few bytes of bss for 
armv7m (other platform should close to it), so we can select it for these 
library by Kconfig.



________________________________
发件人: Xiang Xiao <xiaoxiang781...@gmail.com>
发送时间: 2023年3月10日 22:45:58
收件人: dev@nuttx.apache.org
主题: [External Mail]Re: [Breaking change] Echo character by serial driver

[外部邮件] 此邮件来源于小米公司外部,请谨慎处理。若对邮件安全性存疑,请将邮件转发给mi...@xiaomi.com进行反馈

On Fri, Mar 10, 2023 at 10:39 PM Gregory Nutt <spudan...@gmail.com> wrote:

>
> On 3/10/2023 8:12 AM, Xiang Xiao wrote:
> > The only problem is that terminal is optional:
> >
> https://github.com/apache/nuttx/blob/master/drivers/serial/Kconfig#L167-L174
> > So, if the user doesn't enable CONFIG_SERIAL_TERMIOS in defconfig,
> readline
> > will stop working due to failure to disable ECHO.
>
> 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.


> > Three option here:
> >
> >     1. Remove SERIAL_TERMIOS and enable terminal setting always
> I think so.  I previously argued that TERMIOS should not be optional.
> It is required by POSIX.  There was discussion about the size increase,
> but I don't think there is any significant size increase due to this.
> We could measure the increase with TERMIOS enabled and disabled to see.
> >     2. readline or special tool designed for raw mode select
> SERIAL_TERMIOS
> >     in their config
> That would be insufficient.  Other logic needs TERMIOS too.  Other than
> a size increase, there is no harm in enabling TERMIOS.  But if TERMIOS
> is not enabled, then that can be a source of errors.
> >     3. Keep SERIAL_TERMIOS option, but simulate terminal setting by
> change
> >     isconsole flag
> My recollection is that the isconsole flag was added ONLY to assure that
> lines sent from the console terminated in CR-LF as required by most
> terminal emulators.  It never had anything to do with ECHO or other
> TERMIOS settings recently.  That extension of the semantics is not good
> and introduces lots of problems.  Just because a serial device is the
> console device, that should not generally effect its behavior.
> > Both code size and change is small for option 3.
>
> Except I don't think it is correct.
>
>
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
 This e-mail and its attachments contain confidential information from XIAOMI, 
which is intended only for the person or entity whose address is listed above. 
Any use of the information contained herein in any way (including, but not 
limited to, total or partial disclosure, reproduction, or dissemination) by 
persons other than the intended recipient(s) is prohibited. If you receive this 
e-mail in error, please notify the sender by phone or email immediately and 
delete it!******/#

Reply via email to