public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Backspace
@ 2012-06-20 15:36 Andrew DeFaria
  2012-06-20 18:05 ` Backspace Larry Hall (Cygwin)
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew DeFaria @ 2012-06-20 15:36 UTC (permalink / raw)
  To: cygwin

Have you ever had the backspace key not go backward on character erasing 
the previous character in Windows programs? Neither have I.

This has been bothering me for a while so... I have properly set stty 
erase ^h and from the bash command line backspace works as expected. But 
I often find places where this setting is not honored. I have an 
example. If I type less <filename> and at the less prompt I type "/' to 
find a string, but then make a mistake and hit backspace I get ^? 
instead. But ^h works. Why? Even the man page for less says that 
backspace is supposed to delete the character to the left of the cursor 
but instead I just get ^?.
-- 
Andrew DeFaria <http://defaria.com>
Courage is knowing what not to fear.


--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Backspace
  2012-06-20 15:36 Backspace Andrew DeFaria
@ 2012-06-20 18:05 ` Larry Hall (Cygwin)
  2012-06-21  0:07   ` Backspace Andrew DeFaria
  0 siblings, 1 reply; 10+ messages in thread
From: Larry Hall (Cygwin) @ 2012-06-20 18:05 UTC (permalink / raw)
  To: cygwin

On 6/20/2012 11:35 AM, Andrew DeFaria wrote:
> Have you ever had the backspace key not go backward on character erasing the
> previous character in Windows programs? Neither have I.
>
> This has been bothering me for a while so... I have properly set stty erase
> ^h and from the bash command line backspace works as expected. But I often
> find places where this setting is not honored. I have an example. If I type
> less <filename> and at the less prompt I type "/' to find a string, but then
> make a mistake and hit backspace I get ^? instead. But ^h works. Why? Even
> the man page for less says that backspace is supposed to delete the
> character to the left of the cursor but instead I just get ^?.

I see the same thing if I set stty erase (in bash) as you did and start a
new shell (bash again) from it.  Of course, the parent shell outputs ^? for
any press of backspace.  This behavior is the same for bash started from a
command prompt and from mintty.

Beyond personal preference, is there a reason that you don't just take the
default (i.e. don't set stty erase)?  That works for me.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Backspace
  2012-06-20 18:05 ` Backspace Larry Hall (Cygwin)
@ 2012-06-21  0:07   ` Andrew DeFaria
  2012-06-21  2:06     ` Backspace Larry Hall (Cygwin)
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew DeFaria @ 2012-06-21  0:07 UTC (permalink / raw)
  To: cygwin

On 6/20/2012 11:05 AM, Larry Hall (Cygwin) wrote:
> I see the same thing if I set stty erase (in bash) as you did and 
> start a new shell (bash again) from it.  Of course, the parent shell 
> outputs ^? for any press of backspace.  This behavior is the same for 
> bash started from a command prompt and from mintty.
An stty -a shows erase = ^h. Mintty is set to send ^h when the backspace 
character is pressed. At the bash command line backspace works as 
expected, the previous character is erased. However, if I do less <file> 
backspace does not behave properly or at least... Wait! I'm seeing 
something here.

I get this problem with Console - another, non-Cygwin terminal emulator 
and I see this problem with gnome-terminal. I don't see this problem 
with mintty.

Any idea of how to fix this for say gnome-terminal? Surely there are 
some out there who use regular Linux and gnome-terminal and ssh to 
Cygwin boxes...
> Beyond personal preference, is there a reason that you don't just take 
> the default (i.e. don't set stty erase)?  That works for me.
Ah, cause I want a backspace to backspace? :confused:

Stated differently, I want the backspace key to move backwards one space 
and to erase the previous character, like, for example, the less man 
page says it's supposed to.
-- 
Andrew DeFaria <http://defaria.com>
I took an IQ test and the results were negative.


--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Backspace
  2012-06-21  0:07   ` Backspace Andrew DeFaria
@ 2012-06-21  2:06     ` Larry Hall (Cygwin)
  2012-06-21  5:27       ` Backspace Andrew DeFaria
  0 siblings, 1 reply; 10+ messages in thread
From: Larry Hall (Cygwin) @ 2012-06-21  2:06 UTC (permalink / raw)
  To: cygwin

On 6/20/2012 8:06 PM, Andrew DeFaria wrote:
> On 6/20/2012 11:05 AM, Larry Hall (Cygwin) wrote:
>> I see the same thing if I set stty erase (in bash) as you did and start a
>> new shell (bash again) from it. Of course, the parent shell outputs ^? for
>> any press of backspace. This behavior is the same for bash started from a
>> command prompt and from mintty.
> An stty -a shows erase = ^h. Mintty is set to send ^h when the backspace
> character is pressed. At the bash command line backspace works as expected,
> the previous character is erased. However, if I do less <file> backspace
> does not behave properly or at least... Wait! I'm seeing something here.
>
> I get this problem with Console - another, non-Cygwin terminal emulator and
> I see this problem with gnome-terminal. I don't see this problem with mintty.
>
> Any idea of how to fix this for say gnome-terminal? Surely there are some
> out there who use regular Linux and gnome-terminal and ssh to Cygwin boxes...
>> Beyond personal preference, is there a reason that you don't just take the
>> default (i.e. don't set stty erase)? That works for me.
> Ah, cause I want a backspace to backspace? :confused:
>
> Stated differently, I want the backspace key to move backwards one space and
> to erase the previous character, like, for example, the less man page says
> it's supposed to.

Now methinks you're just being obtuse.

Let me restate what I see in my environment.  Erase is set as ^? but I
didn't set it anywhere.  So to my way of thinking, this is the default.
This makes me think that maybe you have erase set to ^H somewhere?  What
does your .minttyrc look like?  Other resource files?  That's my thought
for what it's worth.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Backspace
  2012-06-21  2:06     ` Backspace Larry Hall (Cygwin)
@ 2012-06-21  5:27       ` Andrew DeFaria
  2012-06-21  9:08         ` Backspace Corinna Vinschen
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew DeFaria @ 2012-06-21  5:27 UTC (permalink / raw)
  To: cygwin

On 06/20/2012 07:05 PM, Larry Hall (Cygwin) wrote:
>> Stated differently, I want the backspace key to move backwards one 
>> space and to erase the previous character, like, for example, the 
>> less man page says it's supposed to.
> Now methinks you're just being obtuse.
I'm not trying to be obtuse. I just want backspace to do a backspace.
> Let me restate what I see in my environment.  Erase is set as ^? but I 
> didn't set it anywhere.  So to my way of thinking, this is the default.
Makes sense.
> This makes me think that maybe you have erase set to ^H somewhere?
Yes, I set it in my ~/.bashrc. Because I believe that big backspace key 
that I love to hit sent C-h.
> What does your .minttyrc look like?
As I said before "I get this problem with Console - another, non-Cygwin 
terminal emulator and
I see this problem with gnome-terminal. I don't see this problem with 
mintty". As such I'm not sure how .minttyrc applies here...
> Other resource files?
Which would you like?

I think you missed the part where I said "I don't see this problem with 
mintty". I see the problem when I use Console ( 
http://sourceforge.net/projects/console/) a non-cygwin terminal emulator 
that I use because it handle's Windows /dev/conin and /dev/conout better 
than Cygwin. I also see this problem when I use my home Ubuntu system's 
gnome-terminal coupled with an ssh to Cygwin running in a Windows 7 VM 
in my LAN.

I found where I can tell gnome-terminal to use C-h for backspace. Thanks 
- that problem is solved. I need to talk to the developer of Console to 
ask him about why Console was not honoring it's "Backspace == Control-H 
setting". And how he handles /dev/conin & conout so that perhaps mintty 
could be made better (Basically Windows programs like say cleartool and 
ActiveState Perl work with Console - i.e. typing cleartool will show you 
the cleartool problem. I think he's running a hidden cmd shell... anyways)

Sorry I didn't test out gnome-terminal but I was at my client's site 
today and didn't have access to gnome-terminal until I got home - 
otherwise I would have tested it and poked around first.
-- 
Andrew DeFaria <http://defaria.com>
Why are a wise man and a wise guy opposites?


--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Backspace
  2012-06-21  5:27       ` Backspace Andrew DeFaria
@ 2012-06-21  9:08         ` Corinna Vinschen
  2012-06-21 15:58           ` Backspace Andrew DeFaria
  0 siblings, 1 reply; 10+ messages in thread
From: Corinna Vinschen @ 2012-06-21  9:08 UTC (permalink / raw)
  To: cygwin

On Jun 20 22:26, Andrew DeFaria wrote:
> On 06/20/2012 07:05 PM, Larry Hall (Cygwin) wrote:
> >>Stated differently, I want the backspace key to move backwards
> >>one space and to erase the previous character, like, for
> >>example, the less man page says it's supposed to.
> >Now methinks you're just being obtuse.
> I'm not trying to be obtuse. I just want backspace to do a backspace.
> >Let me restate what I see in my environment.  Erase is set as ^?
> >but I didn't set it anywhere.  So to my way of thinking, this is
> >the default.
> Makes sense.
> >This makes me think that maybe you have erase set to ^H somewhere?
> Yes, I set it in my ~/.bashrc. Because I believe that big backspace
> key that I love to hit sent C-h.
> >What does your .minttyrc look like?
> As I said before "I get this problem with Console - another,
> non-Cygwin terminal emulator and
> I see this problem with gnome-terminal. I don't see this problem
> with mintty". As such I'm not sure how .minttyrc applies here...
> >Other resource files?
> Which would you like?
> 
> I think you missed the part where I said "I don't see this problem
> with mintty". I see the problem when I use Console (
> http://sourceforge.net/projects/console/) a non-cygwin terminal
> emulator that I use because it handle's Windows /dev/conin and
> /dev/conout better than Cygwin. I also see this problem when I use
> my home Ubuntu system's gnome-terminal coupled with an ssh to Cygwin
> running in a Windows 7 VM in my LAN.
> 
> I found where I can tell gnome-terminal to use C-h for backspace.
> Thanks - that problem is solved. I need to talk to the developer of
> Console to ask him about why Console was not honoring it's
> "Backspace == Control-H setting". And how he handles /dev/conin &
> conout so that perhaps mintty could be made better (Basically
> Windows programs like say cleartool and ActiveState Perl work with
> Console - i.e. typing cleartool will show you the cleartool problem.
> I think he's running a hidden cmd shell... anyways)

I'm not quite sure what you're trying to accomplish by enforcing ^H.
The Cygwin console as well as mintty, the Linux console or any X terminal
emulation I'm aware of default to ^? to be generated by the backspace
key, and stty erase is by default set to ^? as well, usually.  Why don't
you just use the default?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Backspace
  2012-06-21  9:08         ` Backspace Corinna Vinschen
@ 2012-06-21 15:58           ` Andrew DeFaria
  2012-06-21 16:10             ` Backspace Ryan Johnson
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew DeFaria @ 2012-06-21 15:58 UTC (permalink / raw)
  To: cygwin

On 06/21/2012 02:07 AM, Corinna Vinschen wrote:
> I'm not quite sure what you're trying to accomplish by enforcing ^H.
> The Cygwin console as well as mintty, the Linux console or any X terminal
> emulation I'm aware of default to ^? to be generated by the backspace
> key, and stty erase is by default set to ^? as well, usually.  Why don't
> you just use the default?

Because some time in the past I had problem with backspace not working 
and setting erase to ^h fixed it. I've had this setting for years - 
perhaps decades...
-- 
Andrew DeFaria <http://defaria.com>
Opticalrectitus - a condition in which the optic nerve is connected to 
the anus. The major symptom is that all observations are routed through 
the wrong orifice.


--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Backspace
  2012-06-21 15:58           ` Backspace Andrew DeFaria
@ 2012-06-21 16:10             ` Ryan Johnson
  2012-06-21 18:56               ` Backspace Andrew DeFaria
  0 siblings, 1 reply; 10+ messages in thread
From: Ryan Johnson @ 2012-06-21 16:10 UTC (permalink / raw)
  To: cygwin

On 21/06/2012 11:58 AM, Andrew DeFaria wrote:
> On 06/21/2012 02:07 AM, Corinna Vinschen wrote:
>> I'm not quite sure what you're trying to accomplish by enforcing ^H.
>> The Cygwin console as well as mintty, the Linux console or any X 
>> terminal
>> emulation I'm aware of default to ^? to be generated by the backspace
>> key, and stty erase is by default set to ^? as well, usually.  Why don't
>> you just use the default?
>
> Because some time in the past I had problem with backspace not working 
> and setting erase to ^h fixed it. I've had this setting for years - 
> perhaps decades...

At this point I'd revert to defaults until I saw a problem worse than 
those caused by the non-default setting.

If you're only interacting with cygwin and linux at this point, you 
should be safe. Solaris and the other Unixes can be a real pain about 
the whole ^H vs ^? thing, but Solaris has gotten a lot better in the 
last few years and Unix has largely disappeared (I haven't had to 
interact with a Unix box in a decade or so).

Ryan


--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Backspace
  2012-06-21 16:10             ` Backspace Ryan Johnson
@ 2012-06-21 18:56               ` Andrew DeFaria
  2012-06-21 20:07                 ` Backspace Earnie Boyd
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew DeFaria @ 2012-06-21 18:56 UTC (permalink / raw)
  To: cygwin

On 6/21/2012 9:09 AM, Ryan Johnson wrote:
> At this point I'd revert to defaults until I saw a problem worse than 
> those caused by the non-default setting.
I think this is the way to go...
> If you're only interacting with cygwin and linux at this point, you 
> should be safe. Solaris and the other Unixes can be a real pain about 
> the whole ^H vs ^? thing, but Solaris has gotten a lot better in the 
> last few years and Unix has largely disappeared (I haven't had to 
> interact with a Unix box in a decade or so).
I concur here too. Solaris always gets this wrong IIRC. Plus I grew up 
on HP_UX so between those older Unixes I probably came up with that 
setting had it's been carrying on ever since...
-- 
Andrew DeFaria <http://defaria.com>
Ambition is the last refuge of a failure.


--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Backspace
  2012-06-21 18:56               ` Backspace Andrew DeFaria
@ 2012-06-21 20:07                 ` Earnie Boyd
  0 siblings, 0 replies; 10+ messages in thread
From: Earnie Boyd @ 2012-06-21 20:07 UTC (permalink / raw)
  To: cygwin

On Thu, Jun 21, 2012 at 2:56 PM, Andrew DeFaria wrote:
> On 6/21/2012 9:09 AM, Ryan Johnson wrote:
>>
>> At this point I'd revert to defaults until I saw a problem worse than
>> those caused by the non-default setting.
>
> I think this is the way to go...
>>
>> If you're only interacting with cygwin and linux at this point, you should
>> be safe. Solaris and the other Unixes can be a real pain about the whole ^H
>> vs ^? thing, but Solaris has gotten a lot better in the last few years and
>> Unix has largely disappeared (I haven't had to interact with a Unix box in a
>> decade or so).
>
> I concur here too. Solaris always gets this wrong IIRC. Plus I grew up on
> HP_UX so between those older Unixes I probably came up with that setting had
> it's been carrying on ever since...

For what it's worth, I have no erase set on my local Windows client
but erase is set in .profile on the remote servers as ^H and I have no
issues.  I log into both Sun and HP_UX daily.

-- 
Earnie
-- https://sites.google.com/site/earnieboyd

--
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-06-21 20:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-20 15:36 Backspace Andrew DeFaria
2012-06-20 18:05 ` Backspace Larry Hall (Cygwin)
2012-06-21  0:07   ` Backspace Andrew DeFaria
2012-06-21  2:06     ` Backspace Larry Hall (Cygwin)
2012-06-21  5:27       ` Backspace Andrew DeFaria
2012-06-21  9:08         ` Backspace Corinna Vinschen
2012-06-21 15:58           ` Backspace Andrew DeFaria
2012-06-21 16:10             ` Backspace Ryan Johnson
2012-06-21 18:56               ` Backspace Andrew DeFaria
2012-06-21 20:07                 ` Backspace Earnie Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).