Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm connecting to a Solaris machine from WinXP using PuTTY.

When I try to use the NumPad keys for editing a command in Bash (Home, End, Delete) a ~ character is instead printed to the console. Relevant envirnoment parameters as follows:

MACHTYPE=sparc-sun-solaris
SHELL=/bin/bash
HOSTTYPE=sparc
OSTYPE=solaris
TERM=xterm

Can I configure PuTTY to get the NumPad keys working?

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

The path of least resistance is to tell your shell on the Solaris box what the escape sequences sent by PuTTY mean. You see a ~ because these keys emit an escape sequence like ​␛[3~ where ​ is the escape character (\e, ASCII 27). Type Ctrl+V followed by one of the keys so that the ​ character is inserted literally, followed by the other characters. Then define bindings in the relevant file, which for bash is ~/.inputrc:

"\e[3~": delete-char
"\e[1~": beginning-of-line
"\e[4~": end-of-line
share|improve this answer
add comment

Install a terminfo entry (this can be done in your home directory if you do not have root access; you may need to set the TERMINFO variable) corresponding to the actual keys sent by putty. TERM=vt220 or vt420 might actually be close enough, but then you lose color.

This page has some that might work - install terminfo entries with tic, and if necessary you can get termcap data with infocmp -C.

If this doesn't work, you could experiment with different settings for function keys in the putty settings: if it's just home and end that don't work, try xterm - if nothing works, maybe try SCO ANSI and then set the terminfo to e.g. something corresponding to e.g. freebsd console which uses the same keys.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.