Operating System - HP-UX
1821985 Members
3484 Online
109638 Solutions
New Discussion юеВ

Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

 
SOLVED
Go to solution
girija_1
Occasional Advisor

Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

I am using Ksh shell
I need arrows , delete and backspace key to work .

And Up and down arrow to give history
12 REPLIES 12
James R. Ferguson
Acclaimed Contributor

Re: Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

Hi:

If you want this functionality, install the bash shell. Whatever you do, do *NOT* make root's default login shell as defined in '/etc/passwd' anything other than '/sbin/sh'.

As root, you can still dynamically invoke the bash shell if you choose.

You can fetch a 'bash' binary here:

http://hpux.connect.org.uk/hppd/hpux/Shells/bash-4.1.007/

Be sure to install all of the runtime dependencies too!

Regards!

...JRF...
girija_1
Occasional Advisor

Re: Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

I am not the root ... i am one of the user of the box
James R. Ferguson
Acclaimed Contributor

Re: Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

Hi (again):

> I am not the root ... i am one of the user of the box

OK, then you could (if you like) make *your* default login shell. You will still need to install 'bash' as I noted.

Regards!

...JRF...

Matti_Kurkela
Honored Contributor
Solution

Re: Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

Add the following to your .profile:

---------
# backspace: if it does not work, comment the first line
# and uncomment the 2nd
stty erase ^?
# stty erase ^H

# load the rest of shell settings
. $HOME/.kshenvironment
# make sure any child shells will use them too
export ENV=$HOME/.kshenvironment
---------

Then create the .kshenvironment file and write this into it:
---------
# define hpterm cursor keys
alias -x _A=$(echo '\020')
alias -x _B=$(echo '\016')
alias -x _D=$(echo '\002')
alias -x _C=$(echo '\006')

# define vt100 normal (non-application) cursor keys
alias -x __A=$(echo '\020')
alias -x __B=$(echo '\016')
alias -x __D=$(echo '\002')
alias -x __C=$(echo '\006')

# define Home and End for typical vt100 emulations
alias -x __H=$(echo '\001')
alias -x __F=$(echo '\005')

# enable history browsing and command line editing with arrow keys
set -o emacs
---------

This should give you a working backspace, arrows, Home and End keys. I don't remeber whether the Delete key functionality is included in "set -o emacs" or not.

MK
MK
girija_1
Occasional Advisor

Re: Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

Thanks Matti Kurkela

It was grt Help.

But Still my backspace is not working and delete too.

When i gave the backspace it is coming of that line(Just like Ctrl+C)

but here Here Ctrl+C is also not working.
Please tell for that too
Matti_Kurkela
Honored Contributor

Re: Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

If you have in your .profile:

stty erase ^?

and backspace does not work, try this instead:

stty erase ^H

(The correct setting depends on how your terminal/emulator is configured.)

To make Ctrl+C (and a few others) to work, add this command to your .profile:

stty intr ^C kill ^U susp ^Z

You can use the "stty -a" command to view the current settings.

MK
MK
girija_1
Occasional Advisor

Re: Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

Thanks ... it working file now with
stty intr ^C kill ^U susp ^Z
girija_1
Occasional Advisor

Re: Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

Sorry its not working properly ...

If i type ... wrong command
example

iam typing lss and deleted s using backspace and i did enter .. it is giving command not found bz it is appening ^? ...

Prevously i tried with the same shell where i executed stty intr ^C kill ^U susp ^Z ...
i logged of the shell and logged in again .. then i am facing this problem

[seehps000://home/tor]$ ls
ksh: lss^?: not found
[seehps000://home/tor]$
Mike Miller_8
Regular Advisor

Re: Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

try typing:

stty erase (control v)(backspace)

where 'control v' is you holding down the control key and hitting the 'v' character at the same time and backspace is the actual backspace key (the hit enter). After this is done type something and hit the backspace key. If this works add the line to your .kshrc file.
Bill Hassell
Honored Contributor

Re: Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

> it is giving command not found bz it is appening ^?

Very common problem -- it's not HP-UX, it's PuTTY (or whatever terminal emulator you are using). PuTTY emulates the long gone (but not forgotten) DEC terminal where a lot of DEC heritage (Tru64, NonStop, Alpha, etc) of using the DEL key (not backspace). After all, you are deleting a character, right? Unfortunately, the majority of us are so used to backspace that we forget to configure the emulator.

For PuTTY, open the session configuration window, select Keyboard and change Backspace from CTRL-? (DEL) to CTRL-H (backspace). Then save the session. While you're at it, you might change the backgound and foreground colors (Window -> colours).


Bill Hassell, sysadmin
girija_1
Occasional Advisor

Re: Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

yes .. ur right iam using the putty....
BUt when i do that i.e changing the ctrl+? t0 Ctrl+H it is not saving permanently ....

Do i have to for every terminal iam opening ?
Bill Hassell
Honored Contributor

Re: Need backspace , delete , arrows , home and end key to work in Hp-UX 11.11 version

PuTTY is a little cryptic about saving sessions. Once you have made the changes, do NOT Open the terminal window. Instead, creat a name for your session and type it into the box: Saved sessions and press Save. Now you can open the session. In the future, when you open another session, you can do this by left-clicking on the tiny icon at the upper right corner of an existing window and selecting Duplicate Session (to get another identical window) or New Session to open the main PuTTY config window.

You can also create shortcuts on your desktop to automatically open PuTTY with a specific session name, or use one of the very useful PuTTY session managers like PuTTY Connection Manager or PuTTY Session Manager. These tools make it easy to have dozens of preset icons, one for each system in a different color and different settings.


Bill Hassell, sysadmin