This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Various shell problems


> From: "John Morrison" <john dot r dot morrison at ntlworld dot com> 
> To: <cygwin at cygwin dot com> 
>
> Date: Sun, 17 Aug 2003 10:18:56 +0100 
> Subject: RE: Various shell problems 

> > From: Dr.D.J.Picton

> Hi :)

> Thanks for the feedback,

[snip]

> > Unfortunately, I did notice problems with /etc/profile:
> >
> >    Firstly, it sets
> >    stty erase ^?
> >
> >    In my view the correct setting is definitely ^h (backspace).

> *GRIN* before we get into this discussion, I'd like to note
> the "in my view" :)

> To quote:

> "Both keys essentially do the same thing, with one major
> difference. The backspace key deletes to the left of the
> cursor, and the delete key deletes to the right of the cursor.

See below.  I wasn't talking about bash shell input which does indeed work
as described!

> >    Setting the erase character to ^? (delete) causes problems
> >    when 'normal' terminal i/o is used.

> What's a 'normal' terminal?  Do you mean the one you start from
> the cygwin shortcut?  If so, it works for me; what version of bash
> are you running? (it only gets set for bash atm)  I'm using:
> GNU bash, version 2.05b.0(9)-release (i686-pc-cygwin)

Unfortunately there has been a slight misunderstanding here.  I did mean the
cygwin shortcut, and I am using the above version of bash.  However...

By 'normal' input I meant the 'dumb' input to programs which
issue simple terminal reads, e.g. cat or ftp (as opposed to shells which
do complex line editing.)  I'll refer to this type of input as  
'simple' input.  For example, if I create a file using the cat command:

cat > test

the line editing facilities are very limited.  I find I can't reposition the
cursor using the arrow keys.  This moves the cursor, but the cursor key
escape sequences are stored in the file!  The only way to correct the
input is to backspace from the end of the line, and the backspace key
is the logical choice - I'm removing the character to the left of the cursor.
This works if the stty erase character is ^h.  However, if it's been set
to ^?, things tend to break:

1.  In a window started by the cygwin shortcut, I can't backspace input
in simple terminal reads.  The delete key does nothing, and the backspace
key actually generates a ^h character!

2.  In an xterm window without the resource 
*VT100*deleteIsDel: true

Bash input works as advertised, but setting stty erase ^? completely breaks
character deletion in 'simple' input.  The backspace key generates an actual ^h 
character, and the <delete> key produces an escape sequence ...

3.  In an xterm window with the resource
*VT100*deleteIsDel: true

Again, there's no problem with bash input.  I can now set stty erase ^? and
use the delete key as the character erase key in simple input.  But this is
all very counter-intuitive, for the reasons given above.

Another thing I've noticed is that stty echoctl is set in an xterm session, but
it doesn't actually seem to do anything.  I would expect control characters
to be echoed in 'caret' notation in simple input (e.g. ^a for control-A), and
on other systems I find this very useful because it lets me know when I'm
entering control characters.  Is this a known limitation of the terminal
emulation under Cygwin?

> inetutils (of which ftp is part) is at version 1.4.2 on GNU,
> cygwin's ftp is (GNU inetutils) 1.3.2.  Could you try this version
> and, if it fixes the bug, lobby to get cygwin updated?

I'll look into this when I have the time (which isn't right now!)  In the
meantime, the /etc/profile kludge will keep the users happy.

> But of cause, it's *your* /etc/profile now, feel free to hack it :)

> Thanks again for taking the time,

> J.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]