delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/12/02/15:28:55

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=1.9 required=5.0 tests=AWL,BAYES_00,RDNS_DYNAMIC,SPF_HELO_PASS,TVD_RCVD_IP
X-Spam-Check-By: sourceware.org
Mime-Version: 1.0 (Apple Message framework v1082)
Subject: Re: unable to type command into Cygwin after running 'tail'
From: Heath Kehoe <heath AT nozzala DOT net>
In-Reply-To: <AANLkTi=wA08KmvHj1GmQYL2btTC_UMNyr_2vo-n_h8PA@mail.gmail.com>
Date: Thu, 2 Dec 2010 14:28:36 -0600
Message-Id: <251BBCD7-370F-42F1-8305-01F9E6F87D1E@nozzala.net>
References: <30355317 DOT post AT talk DOT nabble DOT com> <4CF70A11 DOT 8020604 AT acm DOT org> <76B81B8B64B6254B98733990F38621DA6A77 AT sron-chi-exc05 DOT ronin DOT roncap DOT com> <4CF7E501 DOT 9080901 AT acm DOT org> <4CF7E822 DOT 2050705 AT cwilson DOT fastmail DOT fm> <AANLkTi=wA08KmvHj1GmQYL2btTC_UMNyr_2vo-n_h8PA AT mail DOT 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 Dec 2, 2010, at 1:59 PM, Andy Koppe wrote:

> On 2 December 2010 18:40, Charles Wilson wrote:
>> On 12/2/2010 1:27 PM, David Rothenberger wrote:
>>> Illia Bobyr wrote:
>>>> On 12/1/2010 8:53 PM, David Rothenberger wrote:
>>>>> Try typing "reset" or "stty sane" (without the quotes) and pressing
>>>>> Enter. You won't see what you're typing, but after the shell should w=
ork
>>>>> again.
>>>>=20
>>>> Would you, please, elaborate on this a little bit?
>>>> Maybe a link or a reference that explains why this is happening?
>>>=20
>>> I'm sorry, I can't. I don't know why it is happening. I just know how to
>>> recover from it as a user.
>>=20
>> I've noticed that this misbehavior occurs more frequently these days:
>> ctrl-c'ing some tasks (tail, less, maybe a few others) ends up with the
>> terminal settings all scrogged up
>=20
> FWIW, I can't reproduce this, even if I kill the tail or less with
> SIGKILL, thus giving them no chance to do any cleanup. (I assume you
> use 'less -K' to allow it to be ctrl-c'ed?)
>=20
> Which shell do people who've seen the problem use? Is it an intermittent =
issue?
>=20

If you SIGKILL a 'less' while it has the tty set for raw/noecho then the tt=
y will stay in that mode. Bash apparently resets the tty to normal for you =
after the process is killed (actually, bash's readline normally runs the tt=
y in a psuedo-raw mode [-icanon min=3D1 -echo] as a matter of course). If y=
ou run 'less' from an 'ash' shell then SIGKILL it, the ash shell will need =
'stty sane' typed in.

Also, the OP said the problem was happening on pipelines like 'tail | grep'=
. Neither tail nor grep muck with tty settings (that I know of), so if the =
tty is ending up with echo disabled, it's got to be the shell leaving it th=
at way. Perhaps there's some kind of race condition in the shell's signal p=
rocessing? So again, we'll need to know which shell this is happening with =
and a way to reliably repro the issue to have any hope of fixing it.

-heath



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