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.

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

At the place where I work we're developing under AIX with ksh and connecting to it via telnet. Most people use ArcTel to connect, while I prefer PuTTY. The only problem I have with PuTTY is that the Del key isn't working - it prints [3~ instead. The funny thing is that in ArcTel it is functioning correctly.

I tried looking at the ArcTel settings and there it only has one switch, called "Backspace and Delete": it can be either "normal" or "VNS-style". I have normal turned on (and Del works as expected). In PuTTY I tried playing around with the keyboard settings and couldn't find a combination that'd make Del do what I want it to do.

Is there a way to make this work in PuTTY? Maybe remapping the [3~ character in my .profile? I don't want to switch from Vi-mode in KSH though.

share|improve this question

I use putty without any problem connecting to AIX. My .profile has

stty erase ^?

and my putty settings have Terminal-keyboard "The Backspace key" checked in Control-? (127)

share|improve this answer

I'm not sure if AIX's ksh supports custom key bindings. I can't find them documented in the AIX manuals, but I think it's a standard ksh feature. Try setting up a binding for \e[3~ (where \e is the escape character). If that works, you can set up bindings for other key combinations as well.

KEYBD_handler () {
  case ${.sh.edchar} in
    $'\e[3~') .sh.edchar=$'\004';;
trap KEYBD_handler KEYBD

($'\004', i.e. Ctrl+D, is the stadndard binding to delete the next character.)

It may be possible to fix this by changing your terminal definition in terminfo. I don't know how to do this in AIX.

On a related note, you may need to either configure PuTTY to send the right character for Backspace, or run stty erase '^?' or stty erase '^h' as appropriate on the AIX machine, or change the terminfo definition to match.

share|improve this answer
Didn't help in my case, I tried putting that in my .profile, ksh didn't have anything against it, but Del still does the same thing it did before. I didn't know about the Ctrl+D shortcut though, thanks. – Anton Zujev Feb 13 '13 at 7:05
@AntonZujev Is that ksh or ksh93? By the way, if you have the option to use bash or zsh, they are a lot better at interactive use than ksh. – Gilles Feb 13 '13 at 11:17
Didn't see the comment before, sorry. How do I find out if it's ksh or ksh93? And I'm afraid we can't change shells here. – Anton Zujev Feb 25 '13 at 12:10
@AntonZujev echo ${KSH_VERSION} or echo ${.sh.version} – Gilles Feb 25 '13 at 12:34
The first command returns a blank line and the seconds gives me "ksh: ${.sh.version}: bad substitution". Any other way? EDIT: Found that I could do it with ESC, then ^V. Got back "Version M-11/16/88f". – Anton Zujev Feb 25 '13 at 12:37

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.