Command-line editing depends on the terminal and remote system agreeing about special keys. Matching PuTTY's Backspace and Delete settings to the remote terminal restores normal editing when a key prints ^H or ^?, does nothing, or deletes the wrong character.

Backspace sends a single control character, which needs to match the remote terminal's erase character. Delete normally sends an escape sequence for forward deletion, but some keyboard modes send a different code. Selecting a mode intended for another terminal can make Delete behave like Backspace instead.

PuTTY can change keyboard behavior in an open connection without interrupting the session. A Unix-like shell exposes the remote erase character through stty; a device console may instead need the mode documented by its vendor. Keys that work at the shell prompt but fail inside one editor point to that application's key bindings or terminal support.

Steps to fix Backspace and Delete keys in PuTTY:

  1. Check the remote terminal's erase character at the connected shell prompt.
    $ stty -a
    speed 38400 baud; rows 16; columns 52; line = 0;
    intr = ^C; quit = ^\; erase = ^H; kill = ^U;
    ##### snipped #####

    The relevant value is erase = ^H or erase = ^?; the other terminal settings can differ.

  2. Click the PuTTY icon in the upper-left corner of the session window to open its menu.
  3. Choose Change Settings from the window menu.
  4. Select Keyboard under Terminal in the Category tree.
  5. Select Control-H under The Backspace key for erase = ^H.

    If the remote value is erase = ^?, select Control-? (127) instead. These options send ASCII 8 and 127 respectively.

  6. Select Xterm R6 under The Function keys and keypad for an xterm-compatible shell.

    SCO mode makes Delete send the same code as Control-?, which can erase to the left. Xterm R6 sends the usual forward-delete sequence; the default ESC[n~ mode also sends that sequence. A console requiring another terminal mode needs its vendor's setting.

  7. Click Apply to activate the keyboard settings in the current connection.

    For future connections, the same keyboard options can be stored in the host's saved session. Changing Default Settings would affect other new sessions too.

  8. Type abc at the shell prompt without pressing Enter.
  9. Press Backspace once to remove c.
  10. Press the Left Arrow key once to position the cursor over b.
  11. Press Delete once to remove b under the cursor.
  12. Confirm that only a remains at the prompt.

    Backspace has removed the character to the left, and Delete has removed the character under the cursor. The test text has not been executed; Ctrl+C clears it.

Share this guide