delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/04/08/07:53:21

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <BANLkTi=4azEVPoi+g3LKvv-Le8+HOtECdg@mail.gmail.com>
References: <BANLkTi=4azEVPoi+g3LKvv-Le8+HOtECdg AT mail DOT gmail DOT com>
Date: Fri, 8 Apr 2011 12:53:08 +0100
Message-ID: <BANLkTi=0Cj9mz2D=gQ1tA3vMHWR1Cuk1=Q@mail.gmail.com>
Subject: Re: stty erase issues on ssh to Linux after upgrade to Windows 7
From: Andy Koppe <andy DOT koppe AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 7 April 2011 22:52, Tom Starr wrote:
> In Windows XP Cygwin erase defaults to ^H (backspace)

Actually Cygwin 1.7 defaults to ^? no matter the Windows version.
Cygwin 1.5 used ^H.


> which is
> preserved on ssh to Linux where backspace works in vi and in SQLPlus.
>
> In Windows 7 Professional erase defaults to ^? (delete) then changes
> to ^H on ssh to the same Linux

The ssh session should inherit the terminal settings from your local
terminal, including 'erase'. Works for me anyway. Perhaps have another
look through the relevant shell startup files on the Linux side,
including the global ones in /etc. You are using Cygwin ssh, right?


> And doing stty erase '^?' (or stty erase ctrl-v <backspace>) in Linux
> fixes vi but SQLPlus still gets little triangles.
>
> My TERM=3Dansi but I=E2=80=99ve also tried vt100 and cygwin - no change.

Which probably means that either SQLPlus is fixed to ^H or it relies
on terminfo, whereas ideally it should pay attention to the 'stty
erase' setting.

You could confirm this by finding a TERM setting that has ^? in the
kbs terminfo capability, e.g. using tput:

$ TERM=3Dxterm tput kbs | cat -v
^?

Then try SQLPlus with that TERM setting. Note, however, that using the
Cygwin console (or any terminal) with an incompatible TERM setting
might cause other problems.


> I upgraded from Cygwin 1.5.25 to 1.7.9 based on 1.7.2 release notes
> stating the console's backspace keycode can be changed using 'stty
> erase' but no change.

Yeah, that turned out to be a bad idea, because some programs set the
erase character to NUL to disable it, which meant that the backspace
key sent NUL.

Hence in 1.7.5 this was replaced with support for the "DEC Backarrow
Key Mode" (DECBKM) control sequence, which can be used like this:

for ^H:  echo -ne '\e[?67h'
for ^?:  echo -ne '\e[?67l'

You'll still want to set 'stty erase' accordingly though.

You might also want to have a look at the mintty terminal, which uses
TERM=3Dxterm, so things might work out-of-the-box. Otherwise, there's a
config dialog option for switching to ^H, which changes both the
backspace keycode and sets the erase character accordingly at startup.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019