How to get arrow keys working in Terminal (not vi) toedit command line inside a terminal (dtterm() type 6 kbd

I just come back to Sun after long long time, memory is fairly shot, so might be considered
to be a daft question. Question is how to get arrow keys working in Terminal (not vi) to edit command line string inside a terminal (dtterm(), Kit is Blade 150 + Type 6 Kbd. (USB)
I can see the scan code ^[[D when I push the key and my instinct is there is a mapping table somewhere that should be US or ASCII not GB somewhere that needs changes to "fix" problem. Where and exactly what do I need to change to get the fix, preferably for 4 arrow keys. Rest of keys appear to work OK.
Any help/pointers appreciated, Dave

What's your shell?
What does echo $0 say typed in shell?
How about set -o vi typed in shell help?

1 Like

ksh.Thank you that is the "fix".

Hi, Thanks for the suggestion, on testing on a real command line of text while it is backspacing Solaris is bleeps indicating bad input so something still not quite right.
keeps bleeping needs a ^C to stop it.
Anything else for me to try please?
regards, Dave

In the shell type stty -erase ^H where ^H is Ctrl key hit together with h.

1 Like

^H no problem. It is not erase that is the problem it works fin . It is the left arrow key to backspace the cursor without erasing, To move back into a command string to correct it. either to erase a typo or insert text within the string The left arrow key throws ^[[D when pressed.

Just a suggestion... Don't use arrow keys. Navigate your command history and edit command as you would edit a file in vi. Same commands.

There's probably a way to fix all keybindings for your particular terminal type, but why bother... If using vi is universal regardless of what terminal, OS or whatever you're in.
If you're an emacs type when it comes to editing (nothing sacriligious about that), you can set -o emacs
Just my $.02

1 Like

Your box is Sparc Solaris I assume.
In Solaris 10 and older there is ksh 88 that does not support cursor keys on the command line.
And I have never bothered to learn the fc stuff.

Switch to bash or zsh, for ex exec bash!
Especially zsh is great in that, but some things differ from ksh.
In contrast, bash has a few problems with the Solaris dtterm and collapses multi-line commands to one line, and it's more similar to ksh.
If you want to have a certain shell by default then switch the login shell, for ex to /bin/bash via the chsh (change shell) command.

Hi, Thanks for taking the time to reply,
Yes I am using Solaris 8 SPARC (it is a sparc9), same as years ago.
At that time the <-- key did what I am describing, that is backing the cursor without wiping out the text it passes over. Not the action I see from the back-space key , ^H , or "set -o vi"; now; all of which delete text. As far as I can remember it was shell neutral, happening below the shell level in the o/s. My memory is very hazy; I suspect there is a keyboard map-file somewhere to let me set this key up to translate the scan code ^[[D to I believe ^V to get the action back-step I require. Looks like I am going to have to start reading the Solaris documentation, Something I was trying to avoid due to bad eyes, already sore from too much screen time. The first thing I have done is switched my shell back to sh via the Admin tool since I have full superuser privileges when needed. I appreciate this is an odd-ball problem. thanks everyone for taking the time to reply, OldBlueBear (dja.)

Did you try zsh or bash?
Switch immediately with

exec zsh

and the cursor keys will work.

Update:
The motion keys work as I described in the Open Windows Desktop on Solaris 8 ,
so inching forward towards a solution, (OBB)

Hummm
Solaris... I used to go mad with the solaris team as they were always changing root or staff .profile adding stty -erase ^? and updating that on all unix servers... where this sequence does not work on HP, and some AIX depending terminal used. stty -erase ^H to me seemed HP specific at the time... So give it a try!

stty erase ^h

Not -erase.

2 Likes

That sets up the backspace to rub-out characters, that already worjks, thank you.
I need a ^b to move left no-rub-out.
I am in at keytable level , I have found /usr/share/lib/keytable/type_6/layout_00
this has the US type 6 (USB) key layout which on inspection has the arrow keys programmed correctly.
Now I am looking to see how this keytable is picked up by the system; I suspect it is picking the wrong keytable. I have found loadkeys(1), having printed off the man pages to take with me tomorrow to study, i am about to shutdown for today - eyes are very sore now. Next session will be Thursday - Thanks everyone for advice- I am certain it can be cracked (fixed).
GN, and 73, OBB (dja.)

I forgot how/which, but there is one or two environment variables that deal with international coding and keyboard layout as I have worked with Solaris boxes in swiss-french layout, and suffered when box was ill and at the console after reboot to get it up having a swiss-french keyboard, and unfortunately while not at user level having to type US-eng... if you can figure out the alphabet, all the signs you need to type on command line like / | * etc are not the things you can easily guess and you find yourself living a great moment of solitude...
That said maybe if you are not in a rush, I could get my sun blade 100 up and finish its installation started hmm 20 years ago...
Have you looked at kdmconfig man pages to see if there is nothing there that can help?

Hi, I have been of on my travels but in between time had a good fish inside Solaris, do not think it is specific to this machine, Cleared a few others "bugs" on the way that were like the NVRAM/TOD chip having a dead battery or near dead and a duff RAM sim causing intermittent core-dumps.

Having a good look at the cursor keys problem I have narrowed it down to one specific widget in the dtterm, The "key mode" toggle on the options terminal drop-down menu is "stuck" permanently in "Applications" setting, as if the reliant binary is "masked off" in that setting or something, I do not yet understand. I would have expected a singe bit in a word somewhere being toggled - flicked between states by mouse clicks

I now have the source of CDE 1.3 but it is almost 600 MB. So not going to be easy for me to find my way to widget or the the "bug" involved.

Do you have a pointer for me, or do you know if this is a known bug and if a patch was issued to fix it as it is fairly fundamental effecting both Console and Terminal (dtterm) command line functionality.
I am not interested in anything beyond eng_US, stripped the foreign stuff out as far as I can - for me it is a wast of HDD space and complexity I do not need.

May end up with a CONUS Solaris 8 media kit if that solves this. Big hammer small nut. Hence question is it a known bug? Is there a patch? If yes what is the patch number? I you can help please do.

OldBlueBear

...

In other words you are kindly asking if I cannot set up my unfinished Solaris8 install on my once new sun blade 100, in solaris 8 to see since same keyboard and yes CDE environment and see if the arrow keys work... I have to get rid of all that is on and in front plus power etc...
So yes I will try, but it might not be up today...

Hi, thank you for replying. And no, i am not asking you to do that. (Install too 90 minutes here) rather I am asking: Do You Know:?

What I asking is if you are aware , (or anyone else on here who has administered Solaris 8)

  1. if you/(or they) know if this "stuck cursor key mode " problem is a know bug in CDE 1.3 under Solaris 8 (2/04) ?
    and
  2. if a "bug fix" patch was issued by Sun for it.
  3. If it was the the next question is what was the parch number please? .
    So it is nothing physical, rather I am asking to tap into the Sun kit knowledge-base on here. Presumably there are people who administered Solaris 8 on here?

As for CDE; unless I am going to spend ?6? six months routing through the source (which I will not do) ; going to have to find another solution, probably another Solaris 8 installation kit.

again thank you for responding,
OldBlueBear

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.