acassis commented on issue #3680:
URL: https://github.com/apache/nuttx-apps/issues/3680#issuecomment-5136271042

   Hi @fdcavalcanti understood, so the issue is because now the escape code is 
echoed before each character sent. Yes, that is wrong.
   
   I think I didn't see this issue because the serial console handles it 
correctly. Please try this fix and let me know if it works for you:
   
   ```
   diff --git a/system/readline/readline_common.c 
b/system/readline/readline_common.c
   index 1642e035e..3d0f570d7 100644
   --- a/system/readline/readline_common.c
   +++ b/system/readline/readline_common.c
   @@ -1598,7 +1598,10 @@ ssize_t readline_common(FAR struct rl_common_s *vtbl, 
FAR char *buf,
    
                  buf[cursor] = (char)ch; nch++; cursor++;
    #  ifdef CONFIG_READLINE_ECHO
   -              redraw_tail(vtbl, buf, nch, cursor);
   +              if (cursor < nch)
   +                {
   +                  redraw_tail(vtbl, buf, nch, cursor);
   +            }
    #  endif
                }
    #else
   -- 
   2.43.0
   ```
   
   Also as you can see "Before: nsh&gt; #x1B[Kls /dev", the you already had 
that escape printed. I suggest you to filter it out:
   
   ```
      ANSI_CSI = re.compile(rb'\x1b\[[0-?]*[ -/]*[@-~]')
      clean = ANSI_CSI.sub(b'', raw)
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to