Re: remote [ssh] Backspace] key gives me "^?"



Chad Perrin wrote:
On Fri, Sep 14, 2007 at 06:01:03PM -0700, Gary Kline wrote:
Sometimes when I ssh from a remote server and edit a file with
vi, my [Backspace keys] are not interpretered correctly. Instead of erasing characters and backing up one byte and
clearing that character my cursor moves forward.

Example: typing "This" as "thos" and backspacing to the 'o'
I'll see "thos^?^?" Can anybody 'splain what idiot thing i'm
doing wrong and how to fix it?

tia,

gary

I tend to guess you're using a terminal emulator from within X when
logging in remotely -- probably aterm or another rxvt-based terminal
emulator. I had similar problems. I don't recall my exact fix, but it
involved a two-tiered approach:

1. set a behavior using stty
2. change a setting in the aterm makefile before installing from ports

My reference to the aterm makefile in part of the solution is because I
suffered this problem when I used aterm as my terminal emulator of
choice. I have since then switched to rxvt-unicode (also known as urxvt)
as my preferred terminal emulator, however, and no longer have this
problem (as well as no longer having funny broken ASCII spew on my screen
when reading email that contains unicode characters).

Best o' luck. Let us know if you think this pseudo-solution doesn't
apply to you so we can help you brainstorm other diagnoses of your
problem.

It's because the TERM'inal emulation / keyboard layout's not meshing. ^?--as I discovered after I asked the question ~8 months ago--is a remnant DEC keyboard mapping, when if properly addressed by setting TERM or fixing the keyboard layout to a standard ASCII keyboard layout, the problem will go away.

In shorter terms, if you...
1. ... switch over to TERM=xterm (assuming that the terminal prog you're using is xterm compatible) under the settings for the app (if they exist) ...
2. ... script in a fix so that it does this in your login shell [you shouldn't use xterm systemwide for your TERM var, especially if you login remotely via SSH and use CLI programs like pine (pine's stupid and doesn't know how to emulate the xterm terminal properly without hacking the source IIRC)] ...
3. ... fix the keyboard layout ...

... '^?' will be replaced with backspaces. 3. is the best solution, but I had to do 1. before, because I didn't have root access on the servers.

Cheers,
-Garrett
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: remote [ssh] Backspace] key gives me "^?"
    ... Sometimes when I ssh from a remote server and edit a file with ... I tend to guess you're using a terminal emulator from within X when ... My reference to the aterm makefile in part of the solution is because I ... when reading email that contains unicode characters). ...
    (freebsd-questions)
  • Re: remote [ssh] Backspace] key gives me "^?"
    ... my [Backspace keys] are not interpretered correctly. ... I tend to guess you're using a terminal emulator from within X when ... when reading email that contains unicode characters). ... It's because the TERM'inal emulation / keyboard layout's not ...
    (freebsd-questions)
  • Re: Spanish language added, but no characters available
    ... The keyboard layout will be exactly the same as ... accents, like ' and ". ... And because I type those characters singly ... Ken Blake - Microsoft MVP Windows: ...
    (microsoft.public.windowsxp.general)
  • Re: What happened to consolechars?
    ... I don't know the answer to where consolechars is hiding, ... describing, where special characters, like line-drawing characters and ... symptom of an application not supporting UTF-8. ... I think it is your terminal emulator which is not ...
    (Debian-User)
  • Re: degree sign
    ... > How To Use the United States-International Keyboard Layout in Windows XP ... > Creating International Characters ... Under or pick a Control Panel icon, click Regional and Language ... > When you press the APOSTROPHE key, QUOTATION MARK key, ACCENT GRAVE ...
    (microsoft.public.windowsxp.general)