From owner-freebsd-questions@FreeBSD.ORG Sat Sep 15 17:58:54 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79A4716A417 for ; Sat, 15 Sep 2007 17:58:54 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout3.cac.washington.edu (mxout3.cac.washington.edu [140.142.32.166]) by mx1.freebsd.org (Postfix) with ESMTP id 5095313C45B for ; Sat, 15 Sep 2007 17:58:54 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.141] (may be forged)) by mxout3.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.06) with ESMTP id l8FHwred002719 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 15 Sep 2007 10:58:53 -0700 X-Auth-Received: from [192.168.10.8] (c-24-10-12-194.hsd1.ca.comcast.net [24.10.12.194]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l8FHwqHV029624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 15 Sep 2007 10:58:53 -0700 Message-ID: <46EC1D5C.3000208@u.washington.edu> Date: Sat, 15 Sep 2007 10:58:52 -0700 From: Garrett Cooper User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: FreeBSD Mailing List References: <20070915010103.GA54302@thought.org> <20070914134128.GB33051@demeter.hydra> In-Reply-To: <20070914134128.GB33051@demeter.hydra> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.3.3.310218, Antispam-Engine: 2.5.2.313940, Antispam-Data: 2007.9.15.103623 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Subject: Re: remote [ssh] Backspace] key gives me "^?" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2007 17:58:54 -0000 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