Operating System - HP-UX
1748125 Members
3165 Online
108758 Solutions
New Discussion юеВ

Re: using "tab", "backspace" and "arrow" keys.

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

using "tab", "backspace" and "arrow" keys.

Hi

I am connecting my HP-UX thru Telnet using putty.

1) I am not able to use "tab key" for auto completion of the command. is it possible in HP-UX like Linux.

2)The whole command is erased When I press "backspace key" to erase a single letter in a command that I entered wrongly.

3)can we use arrow keys to move cursor forward and backword in a command that we are going to execute.
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: using "tab", "backspace" and "arrow" keys.

Shalom,

1)HP-UX uses escape K. I've spoken to several experts and they recommend against trying to make tab work with HP-UX

2)stty erase

3) Escape K.

If you fiddle around enough you can make this stuff work like Linux. However I found it useful to have HP-UX behave differently so I know what type of system I am on.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ganesan R
Honored Contributor
Solution

Re: using "tab", "backspace" and "arrow" keys.

Hi Senthilkumar,

It deponds on the shell which you are using.

For auto completetion you should press Esc key two times after typed first few characters.

For command history you should press Esc+k key combination. Afer Esc+k , press k till you get the desired history command.

You can also install bash shell on HP to get the features of Linux bash shell.
Best wishes,

Ganesh.
senthil_kumar_1
Super Advisor

Re: using "tab", "backspace" and "arrow" keys.

Hi Steven E. Protter

you given this answer

2)stty erase

for my this question

how to erase a single letter if i entered a command wrongly?

I am not able to understand your answer.

Re: using "tab", "backspace" and "arrow" keys.

>> 2)The whole command is erased When I press "backspace key" to erase a single letter in a command that I entered wrongly.


rather than fiddling with stty commands on the HP-UX box its probably easier just to get PuTTY to behave correctly.

In your PuTTY Configuration Dialog, go to Terminal->Keyboard page and change the Backspace key from its default of Control-? (127) to Control-H

Now as long as no-one is hard setting a specific TERM value on the HP-UX server it should work correctly.

As far as the other items are concerned, I agree with the other posters - don't make HP-UX like Linux, learn how to use the vi style command history functions (i.e. press ESC once and then use standard vi editing commands to move about through the current command and command history). The (horrible in my opinion) functionality in Linux is much more a product of the PC "doskey" style functionality which "assumes" all keys are mapped correctly. On UNIX you never know when you'll run across a system where terminal emulation isn't configured correctly, so being able to fall back on a method that doesn't need to use extended keys is much preferrable.

As already indicated, if you really want this functionality install bash on your server. But DO NOT make bash the default shell for root (unless you want to break your box).

HTH

Duncan

I am an HPE Employee
Accept or Kudo
senthil_kumar_1
Super Advisor

Re: using "tab", "backspace" and "arrow" keys.

Still i am not able to auto complete the commands using "esc twice" and not able to get comman history by pressing "esc + k" and again k.


See I am connecting HP-UX server. that is configured with Telnet. and I am using Putty
to connect.

after connecting
1) i am not able to auto complete the commands using pressing "esc twice".
2)i am not able to get comman history by pressing "esc + k" and again k.
Mel Burslan
Honored Contributor

Re: using "tab", "backspace" and "arrow" keys.

Command completion is a function of the shell itself. If you are using csh, these escape twice, will not help you. Unless you have a very compelling reason why you are using csh, I's strongly suggest using POSIX (/usr/bin/sh) or its subset ksh (/usr/bin/ksh) as your default shell and then your command completion esc-esc should work.

In order to scroll up pand down in the command history, using esc-k, first you need to set your command history correctly and history scroll keys (called vi binding I think). In your .profile enter the following:

export HISTFILE=$HOME/.sh_history
export HISTSIZE=500
set -o vi

log out and log back in.
you should be able to perform the functions.

Hope this helps
________________________________
UNIX because I majored in cryptology...
Mel Burslan
Honored Contributor

Re: using "tab", "backspace" and "arrow" keys.

Oh, by the way, if you are planning to use these for root user, please do not change the default shell to anything. It needs to be /sbin/sh . Changing root's default shell is an open invitation to disaster. Thought I should add this word of caution. The command history editing keys as described in my post above, should work with /sbin/sh shell by the way.
________________________________
UNIX because I majored in cryptology...
OldSchool
Honored Contributor

Re: using "tab", "backspace" and "arrow" keys.

the tab, backspace and arrow keys in Linux are part of the bash shell & edlin packages.

if you absolutely have to have them, you will need to install bash and all of its prerequisites.

as noted above, *don't* install anything other then /sbin/sh for root's default shell.

in the event you want bash for root, simply start it at the command line after login