Unusual backspace behavior in Mac terminal

7,748

Solution 1

Running stty erase ^H should fix it, as that is the current control sequence being sent as a backspace.

Solution 2

Make sure the backspace character in the Unix system matches the one in your Mac. If you're using control-H for backspace in the Mac, then use that in the Unix system (stty erase "^H"). If you're using DELETE for backspace in the Mac (shows as "^?" when you do an "stty -a" command), then use that in the Unix system (stty erase "^?").

Share:
7,748

Related videos on Youtube

Peter Mortensen
Author by

Peter Mortensen

Updated on September 17, 2022

Comments

  • Peter Mortensen
    Peter Mortensen over 1 year

    I'm trying to figure out how to get SSH sessions to work how I want using the terminal application on Mac OS X.

    I'm used to using PuTTY on Windows, where backspace means backspace.

    When I press delete/backspace on Mac it deletes the character following the cursor instead of the one before.

    I turned on Delete sends Ctrl + H, and that works most of the time, but sometimes it just shows on the screen as ^H. This is typically at prompts from some custom Python scripts on the box I log into. This doesn't happen with PuTTY on Windows.

    BTW I'm logging into a Ubuntu Linux server running OpenSSH.

    What do I need to do so that backspace is consistently backspace?

  • Nawaz
    Nawaz almost 7 years
    How to type ^? on Mac? ^ followed by ?.... ?
  • Marnix A.  van Ammers
    Marnix A. van Ammers almost 7 years
    Although "^?" represents the single DELETE character, when doing the stty command, the "^" and "?" will have to be typed separately, one after the other and put in quotes.