On 3/10/2023 5:30 PM, Qi3 Huang 黄齐 wrote:

I have to agree that the code is looking better all of the time. Many of the obvious problems that I saw just a couple of days ago have been addressed.  Many of the things I have complained about in this thread have been fixed.  But there are probably more issues that will show up.

I think my biggest concern with the solution is that it > effectively makes it impossible to received any out-of-band data: Any > encoded, context-dependent, escaped data will be echoed back to the > host unconditionally making it impossible to receive cleanly.
But this behavior can be disabled by termios if needed, and it only affect console port by default. And cr/lf convertion also break this.
That is not always true.

 * 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.

   If isconsole is set and TERMIOS is not, then it will always echo the
   input.  The CR-LF  behavior only depends on isconsole and can't be
   changed even if TERMIOS is enabled.

 * Also, the trick of disabling ECHO is not a general solution. You
   cannot disable TERMIOS for asynchronous, out of band input because
   you don't know when that input is going to arrive.

We have already seen this in escape sequences sent from the > host appearing appearing on the user console.  An awful solution > was adopted:  Just remove the escape sequence.  That is called > "sweeping the problem under the rug."   This will be a serious > limitation that will effect our capability to implement many serial > protocols and bad thing to happen to the OS.
The current approach could be improved, such as let readline/cle to erase the escape sequence on console, what's your suggestion ?

   In the case of readline, we know when the ESC sequence is coming.
   readline() asked for the position and the host responded.  For all
   such synchronous input,  we could control the ECHO with TERMIOS. But
   we cannot for other asynchronous, out-of-band input.

In general, I think it's a step forward, why we submit such a patch?


1.Telnet before this patch always echo input twice since telnet echo character itself by default.

I have never seen that behavior.  That bug is probably introduced recently.

Reply via email to