Get putty to play nice with HPUX


As you may have been able to tell, I've had to work with HP-UX systems for the last week or so. While it has been a learning experience I would still choose Linux as my *NIX of choice.

One thing that was particularly bothersome when working with HPUX: ssh sessions don't behave as expected. When I press the backspace key all I see on-screen is a ^? (Control-?):

0ExampleOfBadBackspace.png

Fortunately it is a relatively straight-forward process to correct this when using putty client on Windows systems.

Notes

  • stty (wikipedia.org)
  • putty (chiark.greenend.org.uk)

 

To setup a putty session which interprets the backspace character correctly:

  1. Run stty on the hpux box to find out what the erase key sequence is
    1stty-hpux11.23.png

    In this case, the key sequence is ^H (Control-H) for escape
  2. Open the putty utility and click on Terminal -> Keyboard underneath the "Category" tree
    2ChangePuttyToControlH.png

    Under the Change the sequences sent by: section, change The Backspace key to reflect the value returned by stty in step 1. In my case I changed putty to use Control-H

    Note: at this point you can either connect to the HP-UX machine or save the session for later use (Click on the Session node in the "Categories" tree to save)

  3. Connect to the HP-UX machine with putty set to use the appropriate 'erase' sequence for backspace. You may (or may not) need to change the value of the TERM variable to xterm or vt100 either one worked fine for me. You may not have to change anything.

At this point the back-space key should behave as you would expect on a Linux or Windows system (i.e. it actually deletes the character to the left of the cursor).