Using PuTTY to talk to a device running embedded-cli over USB, PuTTY's default settings cause confusing errors when backspace is used to edit the command line:
$ selftest backplane -d 20
$ selftest backplane -h
error: failed to parseh', expected u32
To type the second line, I pressed up and backspaced away the -d 20, then typed -h. That the error message is malformed allows us to see the issue better, where it can also lead to situations like this one, which is more confusing:
$ selftest backplane -d 20
error: failed to parse '20', expected u32
What's actually happening is that PuTTY defaults to sending a byte with value 127 for backspace, whereas embedded-cli seems to expect only ASCII backspace (byte value 8). When echoed back, commands still contain backspaces that the terminal understands so it's not clear that the application is treating backspaces as further input.
It would be nice if embedded-cli also treated 127 as a backspace character, so PuTTY's default configuration works as expected. It does work to change PuTTY's option to send 8 for backspace instead, but it's a little more annoying to use non-default settings.
Using PuTTY to talk to a device running
embedded-cliover USB, PuTTY's default settings cause confusing errors when backspace is used to edit the command line:To type the second line, I pressed up and backspaced away the
-d 20, then typed-h. That the error message is malformed allows us to see the issue better, where it can also lead to situations like this one, which is more confusing:What's actually happening is that PuTTY defaults to sending a byte with value 127 for backspace, whereas
embedded-cliseems to expect only ASCII backspace (byte value 8). When echoed back, commands still contain backspaces that the terminal understands so it's not clear that the application is treating backspaces as further input.It would be nice if
embedded-clialso treated 127 as a backspace character, so PuTTY's default configuration works as expected. It does work to change PuTTY's option to send 8 for backspace instead, but it's a little more annoying to use non-default settings.