Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Echo function of input string? #12

Open
tonyho opened this issue Jan 16, 2022 · 10 comments
Open

[Feature request] Echo function of input string? #12

tonyho opened this issue Jan 16, 2022 · 10 comments

Comments

@tonyho
Copy link

tonyho commented Jan 16, 2022

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.

@wtarreau
Copy link
Owner

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 :-)

@m4l490n
Copy link

m4l490n commented Jul 2, 2022

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.

@wtarreau
Copy link
Owner

wtarreau commented Jul 2, 2022

I haven't had time to work on it recently, but I kept the issue open to be sure not to forget about it.

@m4l490n
Copy link

m4l490n commented Jul 2, 2022

@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.

@wtarreau
Copy link
Owner

wtarreau commented Jul 3, 2022

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.

@m4l490n
Copy link

m4l490n commented Jul 4, 2022

@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.

@wtarreau
Copy link
Owner

wtarreau commented Jul 4, 2022

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.

@m4l490n
Copy link

m4l490n commented Jul 4, 2022

@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.

@m4l490n
Copy link

m4l490n commented Jul 8, 2022

@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.

@wtarreau
Copy link
Owner

wtarreau commented Jul 8, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants