public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: CTRL-C does not work in Cygwin when using pipes
@ 2015-12-29 22:32 Bill Smith
  2015-12-29 22:57 ` Michael Enright
  2015-12-29 23:52 ` Warren Young
  0 siblings, 2 replies; 8+ messages in thread
From: Bill Smith @ 2015-12-29 22:32 UTC (permalink / raw)
  To: cygwin

[Oops, apologies if I messed up the threading as I wasn't subscribed to the list and noticed there were some replies.]


On 12/29/2015 04:07 PM, Roger Wells wrote:
> a bit more:
> windows 10, mintty, works as hoped.
> windows 10, bash, observe what the OP reported originally

Yes, I'm trying to do this with the standard shell, bash.  We have tried using mintty or the xterm version but there were other issues.  Thanks.

--
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] 8+ messages in thread

* Re: CTRL-C does not work in Cygwin when using pipes
  2015-12-29 22:32 CTRL-C does not work in Cygwin when using pipes Bill Smith
@ 2015-12-29 22:57 ` Michael Enright
  2015-12-30  9:03   ` Michael Enright
  2015-12-29 23:52 ` Warren Young
  1 sibling, 1 reply; 8+ messages in thread
From: Michael Enright @ 2015-12-29 22:57 UTC (permalink / raw)
  To: cygwin

On Tue, Dec 29, 2015 at 2:31 PM, Bill Smith wrote:
> Yes, I'm trying to do this with the standard shell, bash.  We have tried using mintty or the xterm version but there were other issues.

The above implies something but I'm not sure what it is. Can you give
more detail?

mintty and xterm are terminal emulators which can't do much without a
shell inside them.
bash is among the valid shells you can use in mintty or xterm or rxvt.

The default "Cygwin terminal" icon if you set up a minimal Cygwin
installation is mintty serving as a terminal for bash.

So when you say you are trying with the standard shell I'm with you up
to the part where you say, "We have tried using mintty...but there
were other issues" because I use those together.

And since I have chosen to participate in this thread, I tried the
command in question. The success of my attempt does not mean that I
don't believe there's a problem. My setup is Windows 7/64 in a VM,
running 32-bit cygwin, mintty terminal and bash.

--
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] 8+ messages in thread

* Re: CTRL-C does not work in Cygwin when using pipes
  2015-12-29 22:32 CTRL-C does not work in Cygwin when using pipes Bill Smith
  2015-12-29 22:57 ` Michael Enright
@ 2015-12-29 23:52 ` Warren Young
  1 sibling, 0 replies; 8+ messages in thread
From: Warren Young @ 2015-12-29 23:52 UTC (permalink / raw)
  To: The Cygwin Mailing List

On Dec 29, 2015, at 3:31 PM, Bill Smith <bsmith@progress.com> wrote:
> 
> I'm trying to do this with the standard shell, bash.  We have tried using mintty or the xterm version but there were other issues.

Michael is correct: the shell and the terminal are two separate programs.  Your problem isn’t with bash, it’s with the Windows native console.

If the Windows native console were the best way to run an interactive Cygwin command shell, Cygwin wouldn’t default to mintty these days.

That said, Cygwin *used* to run Bash in the Windows Console by default, and I don’t recall Ctrl-C failing in that case.  So, I guess something changed in the cygwin1.dll terminal I/O handling which breaks Ctrl-C handling while a pipe is running.

While waiting for a fix, maybe a more productive way to solve your problem is to address these “issues” you’re having with mintty.  There’s something to be said for running with the standard environment.
--
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] 8+ messages in thread

* Re: CTRL-C does not work in Cygwin when using pipes
  2015-12-29 22:57 ` Michael Enright
@ 2015-12-30  9:03   ` Michael Enright
  2015-12-30  9:11     ` Michael Enright
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Enright @ 2015-12-30  9:03 UTC (permalink / raw)
  To: cygwin

On Tue, Dec 29, 2015 at 2:57 PM, Michael Enright <mike@kmcardiff.com> wrote:
> And since I have chosen to participate in this thread, I tried the
> command in question. The success of my attempt does not mean that I
> don't believe there's a problem. My setup is Windows 7/64 in a VM,
> running 32-bit cygwin, mintty terminal and bash.

Also Windows 10 (not yet updated to November update) 64-bit running
64-bit Cygwin, minty and bash was okay.
Also, for fun, I tried this in Power Shell
> $env:Path += ";C:\cygwin64\bin"
> bash
$ perl -e 'while(1) {sleep 1;}

I was able to control-C out of this.

(And now we all know the way to augment the path in Power Shell!)

Not a recommended way to use Cygwin tools but I thought it was worth adding.

--
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] 8+ messages in thread

* Re: CTRL-C does not work in Cygwin when using pipes
  2015-12-30  9:03   ` Michael Enright
@ 2015-12-30  9:11     ` Michael Enright
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Enright @ 2015-12-30  9:11 UTC (permalink / raw)
  To: cygwin

On Wed, Dec 30, 2015 at 1:03 AM, Michael Enright  wrote:
> On Tue, Dec 29, 2015 at 2:57 PM, Michael Enright  wrote:
>> And since I have chosen to participate in this thread, I tried the
>> command in question. The success of my attempt does not mean that I
>> don't believe there's a problem. My setup is Windows 7/64 in a VM,
>> running 32-bit cygwin, mintty terminal and bash.
>
> Also Windows 10 (not yet updated to November update) 64-bit running
> 64-bit Cygwin, minty and bash was okay.
> Also, for fun, I tried this in Power Shell
>> $env:Path += ";C:\cygwin64\bin"
>> bash
> $ perl -e 'while(1) {sleep 1;}
>
> I was able to control-C out of this.
>
> (And now we all know the way to augment the path in Power Shell!)
>
> Not a recommended way to use Cygwin tools but I thought it was worth adding.

Okay on review the above is not faithful to the problem statement and
so I tried some variations:
In bash inside Power Shell,
 echo foo | perl -e 'while(1) {sleep 1;}'
Will hang.

The same command pipeline, under the condition of having the path
augmented as above, will perform as expected and control-C will stop
the program.

--
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] 8+ messages in thread

* Re: CTRL-C does not work in Cygwin when using pipes
  2015-12-29 20:29 ` Warren Young
@ 2015-12-29 22:06   ` Roger Wells
  0 siblings, 0 replies; 8+ messages in thread
From: Roger Wells @ 2015-12-29 22:06 UTC (permalink / raw)
  To: cygwin

On 12/29/2015 03:29 PM, Warren Young wrote:
> On Dec 29, 2015, at 1:03 PM, Bill Smith <bsmith@progress.com> wrote:
>>
>> echo foo | perl -e 'while(1) {sleep 1;}'
>>
>> CTRL-C does not work.  I have to use Task Manager to kill the perl program.
> 
> Works for me on Windows 10, under both the Cygwin Terminal (mintty) and in a raw cmd.exe window.
> 

a bit more:
windows 10, mintty, works as hoped.
windows 10, bash, observe what the OP reported originally

HTH

> You’ll have to narrow the conditions.
> --
> 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
> 
> 


-- 
Roger Wells, P.E.
leidos
221 Third St
Newport, RI 02840
401-847-4210 (voice)
401-849-1585 (fax)
roger.k.wells@leidos.com

--
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] 8+ messages in thread

* Re: CTRL-C does not work in Cygwin when using pipes
  2015-12-29 20:03 Bill Smith
@ 2015-12-29 20:29 ` Warren Young
  2015-12-29 22:06   ` Roger Wells
  0 siblings, 1 reply; 8+ messages in thread
From: Warren Young @ 2015-12-29 20:29 UTC (permalink / raw)
  To: The Cygwin Mailing List

On Dec 29, 2015, at 1:03 PM, Bill Smith <bsmith@progress.com> wrote:
> 
> echo foo | perl -e 'while(1) {sleep 1;}'
> 
> CTRL-C does not work.  I have to use Task Manager to kill the perl program.

Works for me on Windows 10, under both the Cygwin Terminal (mintty) and in a raw cmd.exe window.

You’ll have to narrow the conditions.
--
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] 8+ messages in thread

* CTRL-C does not work in Cygwin when using pipes
@ 2015-12-29 20:03 Bill Smith
  2015-12-29 20:29 ` Warren Young
  0 siblings, 1 reply; 8+ messages in thread
From: Bill Smith @ 2015-12-29 20:03 UTC (permalink / raw)
  To: cygwin

Hi,

I have observed that CTRL-C does not work when using pipes in Cygwin.  Is this a bug?  Or is there an issue with my stty settings?


If I do this:

perl -e 'while(1) {sleep 1;}'

CTRL-C works



If I do:

echo foo | perl -e 'while(1) {sleep 1;}'

CTRL-C does not work.  I have to use Task Manager to kill the perl program.


I've reproduce the behavior with other Cygwin programs so it's not specific to perl. You could do:

cat <some largefile> | more

to get the same behavior.  I used versions 2.0.1(0.287/5/3) 2015-04-30 18:13 &  2.4.0(0.292/5/3) 2015-12-17 21:59 to reproduce the issue.

Thanks,
--Bill

--
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] 8+ messages in thread

end of thread, other threads:[~2015-12-30  9:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-29 22:32 CTRL-C does not work in Cygwin when using pipes Bill Smith
2015-12-29 22:57 ` Michael Enright
2015-12-30  9:03   ` Michael Enright
2015-12-30  9:11     ` Michael Enright
2015-12-29 23:52 ` Warren Young
  -- strict thread matches above, loose matches on Subject: below --
2015-12-29 20:03 Bill Smith
2015-12-29 20:29 ` Warren Young
2015-12-29 22:06   ` Roger Wells

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