delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/04/14/14:21:51

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_SV,TW_VN,TW_YG,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <BANLkTikxCqvMCC3M5YQzcHM-C80d=DRYpA@mail.gmail.com>
References: <BANLkTikxCqvMCC3M5YQzcHM-C80d=DRYpA AT mail DOT gmail DOT com>
Date: Thu, 14 Apr 2011 19:21:26 +0100
Message-ID: <BANLkTinWsqpzrbZimsJW+zQ6Yz=cOgPu-A@mail.gmail.com>
Subject: Re: 1.7.9-1: typeahead queue not flushed when Ctrl+C pressed
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 4 April 2011 19:39, Edward McGuire wrote:
> When I type ahead in an uncustomized terminal window, I expect my
> keyboard input to be queued until it is called for. When I press
> Ctrl+C, I expect the queue to be flushed. Any keyboard input still
> in the queue should be lost.
>
> The trouble I am having is that my keyboard input is preserved when
> I press Ctrl+C. I can easily reproduce the problem with the
> following keyboard input at a bash prompt:
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0$ tail -f /dev/null [Enter]
> =C2=A0 =C2=A0 =C2=A0 =C2=A0[Enter]
> =C2=A0 =C2=A0 =C2=A0 =C2=A0[Enter]
> =C2=A0 =C2=A0 =C2=A0 =C2=A0[Enter]
> =C2=A0 =C2=A0 =C2=A0 =C2=A0[Ctrl+C]
>
> If the typeahead queue is flushed by the Ctrl+C, then a bash prompt
> will appear. But if the queue is not flushed, then four bash prompts
> will appear. In my case, four bash prompts appear.
>
> I have reproduced the problem in a Cygwin (cmd.exe) window, in a
> mintty window, and in an xterm window.
>
> There is a termio mode bit, NOFLSH, which disables flush after
> interrupt. If this bit were set, it would explain why I am having
> the problem. But "stty -a" shows that this mode bit is not set. I
> checked this bit before and after reproducing the problem.
>
> I was still able to reproduce the problem after setting and clearing
> the NOFLSH bit with "stty noflsh; stty -noflsh".
>
> I have attached the output of "stty -a" below, along with the output
> of "cygcheck -s -v -r" and of "cat /var/log/xwin/XWin.0.log".
>
> I have not found this problem mentioned on the Cygwin list.
>
> Where might I be going wrong? Is this a limitation of the Cygwin
> termio?

Yep, looks like the NOFLSH bit is ignored. There's no mention of it in
the Cygwin sources except in sys/termios.h.

Have you confirmed that it behaves as expected on Linux?

> ...
> $ cygcheck -s -v -r [note: value of svnroot and SVN_SSH variables redacte=
d]
> ...

Thanks for providing this, but it's supposed to be attached rather
than included.

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