[Feature request] `Echo` function of input string?
In minicom, there's an echo on/off setting(Ctrl + A E), this is useful in some cases, like AT Command input.
I searched the echo keyword in this project, and the help output, it seems this function is missing.
Is this function already ready? Or would your add this function?
Thanks for this useful utils.
I noticed the same thing recently and thought that it would indeed be needed. It should not be difficult to add at all, it's just that I initially thought it was pointless before remembering such usages :-)
I second this. I have a board that has a CLI where I need to be able to type commands to tell the board to do something and right now that doesn't seem possible.
I haven't had time to work on it recently, but I kept the issue open to be sure not to forget about it.
@wtarreau you know what, I can enter commands to my board. My only issue is that backspace seems not to be working. I mean I can enter the command then press enter and it is executed but if I make a typo on it there is no way of deleting characters. Is this right? or do I need to configure something.
It is also possible that the code running on your board doesn't support backspace. It's not uncommon for very early boot code for example. Sometimes the DEL key is used instead of backspace. You can try to manually use Ctrl-H to see if it works better, but it's perfectly possible that the board simply doesn't support it there if it works in character mode. For example I've had a number of cheap radio devices that support AT commands that provided no way to erase (probably because they were designed to be called by programs and not by humans).
But do you have a local echo when you type these characters or not ? Because in my experience programs that do not echo the prompt are often the same that do not handle backspace.
@wtarreau the board does support backspace since it works perfectly fine when I use gtkterm. I do get an echo from the device without having to enable echo on the terminal. Enter works and even up and down arrow to search through the device's command history. It is just not possible to delete characters with backspace not go back with the arrows and delete them with delete.
OK I see, so in fact when you press backspace it shows ^H or something similar on the screen but does still really delete the character because the device supports it.
@wtarreau actually nothing happens when I press backspace. And to correct my statement above I can in fact go back in the line using the left arrow but then I get a ~ when pressing DEL instead of having the character deleted. This is consistent with what I get with gtkterm and this means that DEL is not natively supported by the board and all you'll get is a ~ when pressing it.
So it is just the backspace issue. Everything else seems just fine.
@wtarreau I figured it out.
It turns out that the issue was with my terminal. My terminal was configured to handle backspace as DEL 0x7F instead of the actual ASCII for the backspace ^H (0x08). The code on my board can only handle ^H (0x08) and that's why it was not doing anything when receiving the 0x7F.
Ah interesting, thanks for the feedback. I'm wondering if we could implement sort of a debug mode that would echo the hex codes received from the terminal instead of transmitting them. The difficulty is to quit debug mode, this could possibly be achieved using the configured escape character, which would then not be echoed.