Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 19:52 12 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Terminal keyboard direction keys funny

Author Message
plover

Guru

Joined: 18/04/2013
Location: Australia
Posts: 306
Posted: 01:14pm 24 Mar 2019
Copy link to clipboard 
Print this post

In an effort to get my mail accounts to connect properly to my ISP I am straining my brain to come to grips with manual testing of ISP mail server connection.

Running KDE Linux computer, opening a bash terminal which works fine. In this case I open a Telnet or OpenSSL session in the terminal.

I have discovered when I do this that the command line can no longer be navigated with the direction keys. For example moving character pointer left or right I get:

OpenSSL> ^[[A^[[B^[[D^[[C


[[D^, [[C^ in my case is the horizontal direction keys the other two vertical. I vaguely remembered something about some terminal work on this forum able to do something similar. I do not remember where it was.

I have posed the question on the PCLinuxOS Forum but so far have not had any posts after 24 hours, which is unusual but does happen a few times.

Any suggestions?
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4133
Posted: 09:36pm 24 Mar 2019
Copy link to clipboard 
Print this post

What is the question?

Seems rather vague...

John
 
plover

Guru

Joined: 18/04/2013
Location: Australia
Posts: 306
Posted: 12:11am 25 Mar 2019
Copy link to clipboard 
Print this post

Why can I not use the left direction key to move back on the command line?

OpenSSL> hepp^[[D^[[D


The example above, 'help' got misspelled and I tried to use the left direction key to move two characters left. Shown I have hit the left direction key twice, so response to direction key is

[[D^


In this case it was simple enough to use the backspace but in the example following

# openssl s_client -starttls ssmtp -showcerts -connect mail.example.com:587


the mistake is in ssmtp, one s too many so here using direction keys suddenly seems very attractive. Using the backspace and retyping from memory is not working for me either.

If there was a command to clear the cmd line I can use the mouse to copy and paste from a text file (that is what I do for long lines).

The mouse can not reposition caret in the command line either.Edited by plover 2019-03-26
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 01:45am 25 Mar 2019
Copy link to clipboard 
Print this post

Not familiar enough with Linux to answer properly but it would appear that once you open a session with your ISP, you are sending character by character rather than building a line and sending it complete with a CR. The ISP is grabbing your arrow keys and translating them into escape codes and echoing back to you.

Can't see an obvious solution sorry,
panky.

Edit: Actually, the following link may be helpfull.
here Edited by panky 2019-03-26
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4133
Posted: 01:06pm 26 Mar 2019
Copy link to clipboard 
Print this post

That example:
openssl s_client -starttls ssmtp -showcerts -connect mail.example.com:587

just gives me a usage message (due to the bad arg ssmtp) and so for me it does not behave as described.

John
 
plover

Guru

Joined: 18/04/2013
Location: Australia
Posts: 306
Posted: 09:22am 28 Mar 2019
Copy link to clipboard 
Print this post

The long command line was just to demonstrate why using direction left key would have been handy to get back to the "bad argument"

[gert@KDE5-os1-plasma5 ~]$ openssl
OpenSSL> ^[[D^[[D
Invalid command'; type "help" for a list.
error in
OpenSSL>


In above I used the left direction key only twice and then

When entering the 'openssl' I am guessing another style of terminal action is invoked, guessing that the keyboard mapping is changed.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4133
Posted: 02:35pm 28 Mar 2019
Copy link to clipboard 
Print this post

It looks like it's setting raw or the like but I don't know for sure or why.

I'm guessing - have you searched on the net and found no answer?

If not, look up the maintainer(s) and/or author(s) and ask them your question(s).

Or, read the source - unlike a lot of software it is available.

I suppose if none of those appeal you could do what you'd have to do with proprietary software and pay someone to pursue it for you - er, not me though :)

JohnEdited by JohnS 2019-03-30
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025