Guides Linux Server Fix: Backspacing on OSX Terminal Should Not Be...

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 protected]:.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).

Follow ServerWatch on Twitter

Latest Posts

How to Convert a Physical Computer to a Virtual Machine

Many organizations are implementing virtualization technology into their networks to convert physical computers to virtual machines (VM). This helps reduce overall physical hardware costs,...

HPE ProLiant DL380 Gen10: Rack Server Overview and Insight

The HPE ProLiant DL380 series has consistently been a market leader in the server space. The Gen10 released in 2017 further increased HPE's market...

Best Server Management Software & Tools 2021

Finding the best server management software tools for your organization can have a major impact on the success of your business operations. Manually handling...

IBM AS/400: Lasting the Test of Time

Some server operating systems (OS) were built to survive the test of time – the IBM AS/400 is one such system.  The AS/400 (Application System/400)...

What is Disaster Recovery?

The modern organization's heavy dependence on using data to drive their business has made having a Disaster Recovery (DR) plan in place a necessity....

Related Stories