Skip to content

[BUG] NSH outputting garbage #3680

Description

@fdcavalcanti

Description / Steps to reproduce the issue

Hello folks!

Seems some changes on NSH have absolutely obliterated Espressif's internal CI.
I have traced the issue using git bisect to the following commit:

The issue is that pytest-embedded-nuttx is parsing the command line and fails to match the regex for the echo $? command.
Analyzing the serial output as received by the tool we have this:

  • Issues commands:

    • ls /dev
    • echo $?
  • Before the changes

nsh> #x1B[Kls /dev
/dev:
 console
 null
 random
 ttyS0
 zero
nsh> #x1B[K
nsh> #x1B[Kecho $?
0
nsh> #x1B[K
  • After the changes:
nsh> #x1B[Kl#x1B[Ks#x1B[K #x1B[K/#x1B[Kd#x1B[Ke#x1B[Kv#x1B[K
/dev:
 console
 null
 random
 ttyS0
 zero
nsh> #x1B[K
nsh> #x1B[Ke#x1B[Kc#x1B[Kh#x1B[Ko#x1B[K #x1B[K$#x1B[K?#x1B[K
0
nsh> #x1B[K

I´m not aware if those are ANSI or UTF-something escape values, but seems there is a symbol repeating before each character that is passed to the serial output (#x1B[K).

Please if someone can check and confirm if that is expected. If so, how should we parse it?

Thanks in advance.

On which OS does this issue occur?

[OS: Linux]

What is the version of your OS?

Mint 22

NuttX Version

master

Issue Architecture

[Arch: risc-v]

Issue Area

[Area: NSH]

Host information

Board used is esp32c3-devkit:nsh.

Verification

  • I have verified before submitting the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions