Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Backspace still quirky in vim through ssh

Backspace still quirky in vim through ssh
Thread Tools
Fresh-Faced Recruit
Join Date: Nov 2004
Status: Offline
Reply With Quote
Jan 18, 2007, 10:12 AM
 
Hi, folks,

So why is this backspace/delete thing so hard to fix? So I have an external PC keyboard attached to my Macbook which I use at home. My problem:

when I ssh to a remote server and fire up vim, the backspace key (PC keyboard) does nothing when I want to delete something. Same as the delete key on my Mac keyboard.

Also, I have no problem with backspace (PC keyboard) or delete key (Mac keyboard) on my local 10.4.8 when using Vim 6.2 came with my Macbook. But if I try to use Vim 6.3 installed by Fink, I have the same problem as described above.

Any idea? Thanks.
     
Mac Elite
Join Date: Mar 2001
Location: Minneapolis, MN
Status: Offline
Reply With Quote
Jan 18, 2007, 11:50 AM
 
     
Mac Elite
Join Date: Mar 2001
Location: Minneapolis, MN
Status: Offline
Reply With Quote
Jan 18, 2007, 11:53 AM
 
A few others to try:

-----

Easy fix: Terminal, Preferences menu, "Declare terminal type ($TERM) as: [vt102]" instead of [xterm-color].

-----

This is a very common and very annoying problem. Your remote host expects some character to be used as "erase", a terminal program you use sending some character as "erase". If they differ - sometimes you getting ^? or ^H when pressing backspace. So to fix this you just need bring both parts in sync.
1. When connected type "stty -a" and in output find what is expected to be an erase code (erase = ^? f.e.)
2. Type CTRL-v and press your backspace. You'll see what code is sent as "erase". ^H f.e.
3. Type "stty erase ^H" and this is it. Now they'll understand each other.

-----

The solution: Copy the xterm-color terminfo file from a Mac to the Linux box. Use the one installed by default at /usr/share/terminfo/78/xterm-color. You can put the file in /usr/share/terminfo/x/ on the Linux box (if you have root access), or in your home directory in ~/.terminfo -> x/ (create the directory structure if necessary). Then log out and SSH back into the Linux machine, and your backspace key should work properly in all applications.
     
Fresh-Faced Recruit
Join Date: Nov 2004
Status: Offline
Reply With Quote
Jan 18, 2007, 04:15 PM
 
Thanks a lot, guys. This really helps.
     
Addicted to MacNN
Join Date: Oct 2002
Location: England | San Francisco
Status: Offline
Reply With Quote
Jan 19, 2007, 07:18 AM
 
tried iTerm? sooo much nicer than Terminal
we don't have time to stop for gas
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:25 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2