Linux Server Fix: Backspacing on OSX Terminal Should Not Be Interpreted as Delete
I have accounts on a number of Linux machines that I ssh into from my MacBook, using Terminal. On some -- but not all -- of them, I've found that if I run screen after connection, the backspace key is interpreted as a delete (giving an error if the cursor is at the end of the line), and I have to use Ctrl-H to backspace. After poking around a little online, I found several possible ways to fix this.
Change the $TERM Setting of Your ssh Session Once Logged On
|Tip of the Trade: Backspace and delete may seem the same, but often they are not. This is particularly problematic when using Screen on OSX Terminal. Here are three easy fixes.
export TERM=xterm; screen
You can make this permanent by either putting the $TERM setting into your .bashrc or aliasing screen.
alias screen="export TERM=xterm; screen"
However, in the first case, your terminal isn't identified as xterm-color, which may affect other settings (such as your bash prompt). This isn't a problem in the second case (screen sets $TERM to 'screen'), but it's a bit of a hack.
Copy the Terminfo File for xterm-color From Your Mac Onto the Remote Linux Box
scp /usr/share/terminfo/78/xterm-color email@example.com:.terminfo/x/
Thank you MacOSXHints for this suggestion. Log back in, run screen, and all should be well. This shouldn't cause problems if logging in from a non-Mac OS X box.
The Quickest Option
In the Advanced tab of the Terminal Preferences menu, there's an option to make backspace send Ctrl-H. Curiously, however, it's only for screen that you must tick this; backspace works fine with regular ssh.
So far I've preferred the second option, as it feels to me like a cleaner fix. The third option does have the advantage that you need only do it once (on your local machine), not once per remote account.
Juliet Kemp has been messing around with Linux systems, for financial reward and otherwise, for about a decade. She is also the author of "Linux System Administration Recipes: A Problem-Solution Approach" (Apress, 2009).
IT Solutions Builder TOP IT RESOURCES TO MOVE YOUR BUSINESS FORWARD
Which topic are you interested in?
What is your company size?
What is your job title?
What is your job function?
Searching our resource database to find your matches...