1

I'm working with picocom running inside gnome-terminal. I have local echo switched on inside picocom using the -e option, and when I backspace I can see that caret moves backwards, however the previously printed characters are still left in place. I had a look at the emap option in picocom that allows the mapping BS to DEL and vice versa before echoing to the terminal, but this does not have the desired effect.

How do I configure gnome-terminal and/or picocom to remove the characters from the terminal when I press backspace?

1

I'm not familiar to picocom, so I can't give you an answer, but can give you an explanation for the behavior which you might find useful.

When working with terminals, the input (keyboard) and the output (stuff sent to the terminal to be printed) have to clearly be distinguished from each other.

As for the input, the keyboard's backspace key sends either ^H (ascii 0x08) or ^? (ascii 0x7F) depending on some settings.

As for the output: ^H moves the cursor to the left (without erasing anything), while ^? is a no-op (or maybe undefined).

Whenever you press the backspace key and it "works as expected", behind the scenes someone (e.g. your shell, or the kernel's tty layer) translates the incoming ^H or ^? into the output sequence: ^H followed by a space followed by another ^H.

I assume that picocom doesn't do such translation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.