Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


Can I configure PuTTY to get the NumPad keys working?

share|improve this question
up vote 7 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[1~": beginning-of-line     # Home
"\e[4~": end-of-line           # End
"\e[5~": beginning-of-history  # PageUp
"\e[6~": end-of-history        # PageDown
"\e[3~": delete-char           # Delete
"\e[2~": quoted-insert         # Insert
"\eOD": backward-word          # Ctrl+Left
"\eOC": forward-word           # Ctrl+Right
share|improve this answer

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

Your Answer


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.