public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* CTRL+C is not working with java on latest cygwin 1.7.15
@ 2012-07-11 18:47 saltnlight5
  2012-07-11 19:18 ` K Stahl
  2012-07-12 21:57 ` saltnlight5
  0 siblings, 2 replies; 21+ messages in thread
From: saltnlight5 @ 2012-07-11 18:47 UTC (permalink / raw)
  To: cygwin


Hi there,

Before I upgraded cygwin, I used to be able to press CTRL+C to any java
program, and it will trigger's shutdownhook and exit. But since I upgraded
to latest cygwin, this is no longer working. Has anyone has this problem?

My cygwin version:
$ uname -a
CYGWIN_NT-5.1 L328BDS002023US 1.7.15(0.260/5/3) 2012-05-09 10:25 i686 Cygwin

I did see an old post discussed the same thing, but I did not see a
solution.
http://cygwin.com/ml/cygwin/2012-05/msg00372.html

Can someone in the list help?

Thanks
Zemian

-----
----
Zemian Deng
-- 
View this message in context: http://old.nabble.com/CTRL%2BC-is-not-working-with-java-on-latest-cygwin-1.7.15-tp34147441p34147441.html
Sent from the Cygwin list mailing list archive at Nabble.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] 21+ messages in thread

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 18:47 CTRL+C is not working with java on latest cygwin 1.7.15 saltnlight5
@ 2012-07-11 19:18 ` K Stahl
       [not found]   ` <1355306723156-63181.post@n5.nabble.com>
                     ` (2 more replies)
  2012-07-12 21:57 ` saltnlight5
  1 sibling, 3 replies; 21+ messages in thread
From: K Stahl @ 2012-07-11 19:18 UTC (permalink / raw)
  To: cygwin

Just tested with this against the latest release version (1.7.15) and
everything works as expected.

Example:
public final class Test {
    public static void main(String[] args) {
        System.out.println("This shall hang until CTRL-C is pressed...");
        for (;;);
    }
}

javac -cp . Test.java
java -cp . Test

Press CTRL-C and you are returned to the terminal.

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

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 19:18 ` K Stahl
       [not found]   ` <1355306723156-63181.post@n5.nabble.com>
@ 2012-07-11 19:55   ` saltnlight5
  2012-07-11 20:06     ` K Stahl
  2012-07-11 20:07     ` saltnlight5
  2012-07-12 14:24   ` Aaron Schneider
  2 siblings, 2 replies; 21+ messages in thread
From: saltnlight5 @ 2012-07-11 19:55 UTC (permalink / raw)
  To: cygwin


I do have the latest cygwin install. In fact I re-installed just today and
it's still not working.

I printed the full version in my previous email. Was that not the lastest
cygwin version?


K Stahl wrote:
> 
> Just tested with this against the latest release version (1.7.15) and
> everything works as expected.
> 
> Example:
> public final class Test {
>     public static void main(String[] args) {
>         System.out.println("This shall hang until CTRL-C is pressed...");
>         for (;;);
>     }
> }
> 
> javac -cp . Test.java
> java -cp . Test
> 
> Press CTRL-C and you are returned to the terminal.
> 
> --
> 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
> 
> 
> 


-----
----
Zemian Deng
-- 
View this message in context: http://old.nabble.com/CTRL%2BC-is-not-working-with-java-on-latest-cygwin-1.7.15-tp34147441p34147783.html
Sent from the Cygwin list mailing list archive at Nabble.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] 21+ messages in thread

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 19:55   ` saltnlight5
@ 2012-07-11 20:06     ` K Stahl
  2012-07-11 20:07     ` saltnlight5
  1 sibling, 0 replies; 21+ messages in thread
From: K Stahl @ 2012-07-11 20:06 UTC (permalink / raw)
  To: cygwin

You are correct in that you have the latest Cygwin release, but have
you tried the test app I have provided?  My assumption is that your
application or its invocation script is causing the issue, not Cygwin
itself.

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

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 19:55   ` saltnlight5
  2012-07-11 20:06     ` K Stahl
@ 2012-07-11 20:07     ` saltnlight5
  2012-07-11 20:17       ` K Stahl
                         ` (2 more replies)
  1 sibling, 3 replies; 21+ messages in thread
From: saltnlight5 @ 2012-07-11 20:07 UTC (permalink / raw)
  To: cygwin


Thanks for the reply "K Stahl", but it didn't work for me. I ran the same
Test, then press CTRL+C. But the cygwin terminal did nothing. It did not
stop the java process, and it did not print any thing further. I must
manually terminate the process by going into Windows TaskManager. 

Again, here is my cygwin version:
$ uname -srv
CYGWIN_NT-5.1 1.7.15(0.260/5/3) 2012-05-09 10:25

Am I on the latest version as you said? Did I miss any other config?

Thanks
Zemian


saltnlight5 wrote:
> 
> I do have the latest cygwin install. In fact I re-installed just today and
> it's still not working.
> 
> I printed the full version in my previous email. Was that not the lastest
> cygwin version?
> 
> 
> K Stahl wrote:
>> 
>> Just tested with this against the latest release version (1.7.15) and
>> everything works as expected.
>> 
>> Example:
>> public final class Test {
>>     public static void main(String[] args) {
>>         System.out.println("This shall hang until CTRL-C is pressed...");
>>         for (;;);
>>     }
>> }
>> 
>> javac -cp . Test.java
>> java -cp . Test
>> 
>> Press CTRL-C and you are returned to the terminal.
>> 
>> --
>> 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
>> 
>> 
>> 
> 
> 


-----
----
Zemian Deng
-- 
View this message in context: http://old.nabble.com/CTRL%2BC-is-not-working-with-java-on-latest-cygwin-1.7.15-tp34147441p34147841.html
Sent from the Cygwin list mailing list archive at Nabble.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] 21+ messages in thread

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 20:07     ` saltnlight5
@ 2012-07-11 20:17       ` K Stahl
  2012-07-11 20:26         ` saltnlight5
  2012-07-12 20:13       ` James Johnston
  2012-08-02 17:31       ` Roger K. Wells
  2 siblings, 1 reply; 21+ messages in thread
From: K Stahl @ 2012-07-11 20:17 UTC (permalink / raw)
  To: cygwin

Hmm, what version of Java are you using?  Mine example was tested on Java 1.6.

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

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 20:17       ` K Stahl
@ 2012-07-11 20:26         ` saltnlight5
  2012-07-11 20:34           ` K Stahl
  0 siblings, 1 reply; 21+ messages in thread
From: saltnlight5 @ 2012-07-11 20:26 UTC (permalink / raw)
  To: cygwin


Hi,

I did compile and ran your Test.java program, and it's not working. I have
java 6

$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode)


K Stahl wrote:
> 
> Hmm, what version of Java are you using?  Mine example was tested on Java
> 1.6.
> 
> --
> 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
> 
> 
> 


-----
----
Zemian Deng
-- 
View this message in context: http://old.nabble.com/CTRL%2BC-is-not-working-with-java-on-latest-cygwin-1.7.15-tp34147441p34147965.html
Sent from the Cygwin list mailing list archive at Nabble.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] 21+ messages in thread

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 20:26         ` saltnlight5
@ 2012-07-11 20:34           ` K Stahl
  2012-07-11 20:37             ` K Stahl
  2012-07-12  1:40             ` Earnie Boyd
  0 siblings, 2 replies; 21+ messages in thread
From: K Stahl @ 2012-07-11 20:34 UTC (permalink / raw)
  To: cygwin

Seems to me that I've had this issue in the past, but for the life of
me, I cannot remember how it was resolved.  Maybe someone else can
weigh in on this topic with some possible suggestions?

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

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 20:34           ` K Stahl
@ 2012-07-11 20:37             ` K Stahl
  2012-07-12  1:40             ` Earnie Boyd
  1 sibling, 0 replies; 21+ messages in thread
From: K Stahl @ 2012-07-11 20:37 UTC (permalink / raw)
  To: cygwin

Just out of curiosity, what is your exact version of Java?

Post the result of: java --version

On Wed, Jul 11, 2012 at 4:34 PM, K Stahl <kdstahl@gmail.com> wrote:
> Seems to me that I've had this issue in the past, but for the life of
> me, I cannot remember how it was resolved.  Maybe someone else can
> weigh in on this topic with some possible suggestions?

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

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 20:34           ` K Stahl
  2012-07-11 20:37             ` K Stahl
@ 2012-07-12  1:40             ` Earnie Boyd
  2012-07-12 13:02               ` saltnlight5
  1 sibling, 1 reply; 21+ messages in thread
From: Earnie Boyd @ 2012-07-12  1:40 UTC (permalink / raw)
  To: cygwin

On Wed, Jul 11, 2012 at 4:34 PM, K Stahl wrote:
> Seems to me that I've had this issue in the past, but for the life of
> me, I cannot remember how it was resolved.  Maybe someone else can
> weigh in on this topic with some possible suggestions?

Maybe the value of the CYGWIN variable.

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

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-12  1:40             ` Earnie Boyd
@ 2012-07-12 13:02               ` saltnlight5
  2012-07-12 13:23                 ` K Stahl
  2012-07-12 15:39                 ` Earnie Boyd
  0 siblings, 2 replies; 21+ messages in thread
From: saltnlight5 @ 2012-07-12 13:02 UTC (permalink / raw)
  To: cygwin


@Earnie
What value should I set to CYGWIN that you think it may affect CTRL+C
behavior. I looked at http://cygwin.com/cygwin-ug-net/using-cygwinenv.html
and I don't see any entries that related to CTRL+C.

@K Stahl
I did print you mine full java -version. See my previous email.

Thanks,
Zemian


Earnie wrote:
> 
> On Wed, Jul 11, 2012 at 4:34 PM, K Stahl wrote:
>> Seems to me that I've had this issue in the past, but for the life of
>> me, I cannot remember how it was resolved.  Maybe someone else can
>> weigh in on this topic with some possible suggestions?
> 
> Maybe the value of the CYGWIN variable.
> 
> -- 
> 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
> 
> 
> 


-----
----
Zemian Deng
-- 
View this message in context: http://old.nabble.com/CTRL%2BC-is-not-working-with-java-on-latest-cygwin-1.7.15-tp34147441p34150780.html
Sent from the Cygwin list mailing list archive at Nabble.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] 21+ messages in thread

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-12 13:02               ` saltnlight5
@ 2012-07-12 13:23                 ` K Stahl
  2012-07-12 15:39                 ` Earnie Boyd
  1 sibling, 0 replies; 21+ messages in thread
From: K Stahl @ 2012-07-12 13:23 UTC (permalink / raw)
  To: cygwin

Hmm, I thought this was an issue in a early release of 1.6.  Seeing as
you have a pretty recent release, I'm still at a loss.

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

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 19:18 ` K Stahl
       [not found]   ` <1355306723156-63181.post@n5.nabble.com>
  2012-07-11 19:55   ` saltnlight5
@ 2012-07-12 14:24   ` Aaron Schneider
  2 siblings, 0 replies; 21+ messages in thread
From: Aaron Schneider @ 2012-07-12 14:24 UTC (permalink / raw)
  To: cygwin

On 11/07/2012 21:17, K Stahl wrote:
> Just tested with this against the latest release version (1.7.15) and
> everything works as expected.
>
> Example:
> public final class Test {
>      public static void main(String[] args) {
>          System.out.println("This shall hang until CTRL-C is pressed...");
>          for (;;);
>      }
> }
>
> javac -cp . Test.java
> java -cp . Test
>
> Press CTRL-C and you are returned to the terminal.
>
> --
> 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
>
>
>

Tested here and working correctly.

$ uname -a
CYGWIN_NT-6.1-WOW64 LAPTOP 1.7.15(0.260/5/3) 2012-05-09 10:25 i686 Cygwin

$ java -version
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode)

$ javac -version
javac 1.6.0_25

On 11/07/2012 22:26, saltnlight5 wrote:>
 > Hi,
 >
 > I did compile and ran your Test.java program, and it's not working. I 
have
 > java 6
 >
 > $ java -version
 > java version "1.6.0_26"
 > Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
 > Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode)
 >
 >
 > K Stahl wrote:
 >>
 >> Hmm, what version of Java are you using?  Mine example was tested on 
Java
 >> 1.6.
 >>
 >> --
 >> 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
 >>
 >>
 >>
 >
 >
 > -----
 > ----
 > Zemian Deng
 >

saltnlight5, could you try a fresh install of cygwin just to test?

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

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-12 13:02               ` saltnlight5
  2012-07-12 13:23                 ` K Stahl
@ 2012-07-12 15:39                 ` Earnie Boyd
  1 sibling, 0 replies; 21+ messages in thread
From: Earnie Boyd @ 2012-07-12 15:39 UTC (permalink / raw)
  To: cygwin

On Thu, Jul 12, 2012 at 9:02 AM, saltnlight5 wrote:
>
> @Earnie
> What value should I set to CYGWIN that you think it may affect CTRL+C
> behavior. I looked at http://cygwin.com/cygwin-ug-net/using-cygwinenv.html
> and I don't see any entries that related to CTRL+C.

Two people with two differing results also need to compare the
environment settings.  Perhaps it is the difference.

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

* RE: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 20:07     ` saltnlight5
  2012-07-11 20:17       ` K Stahl
@ 2012-07-12 20:13       ` James Johnston
  2012-07-12 21:39         ` saltnlight5
  2012-08-02 17:31       ` Roger K. Wells
  2 siblings, 1 reply; 21+ messages in thread
From: James Johnston @ 2012-07-12 20:13 UTC (permalink / raw)
  To: 'saltnlight5', cygwin

> -----Original Message-----
> Sent: Wednesday, July 11, 2012 20:07
> Subject: Re: CTRL+C is not working with java on latest cygwin 1.7.15
> 
> 
> Thanks for the reply "K Stahl", but it didn't work for me. I ran the same
Test,
> then press CTRL+C. But the cygwin terminal did nothing. It did not stop
the
> java process, and it did not print any thing further. I must manually
terminate
> the process by going into Windows TaskManager.
> 
> Again, here is my cygwin version:
> $ uname -srv
> CYGWIN_NT-5.1 1.7.15(0.260/5/3) 2012-05-09 10:25
> 
> Am I on the latest version as you said? Did I miss any other config?

Actually, not so much on the latest version.  Did you try the most recent
Cygwin snapshot?  Version 1.7.15 has some problems with hanging when running
non-Cygwin programs but this was fixed in a later snapshot, perhaps this is
related?


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

* RE: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-12 20:13       ` James Johnston
@ 2012-07-12 21:39         ` saltnlight5
  0 siblings, 0 replies; 21+ messages in thread
From: saltnlight5 @ 2012-07-12 21:39 UTC (permalink / raw)
  To: cygwin


Thanks for the tips James, however, I tried the lastest snaphost
cygwin1-20120708.dll.bz2 it still not working.


James Johnston-5 wrote:
> 
>> -----Original Message-----
>> Sent: Wednesday, July 11, 2012 20:07
>> Subject: Re: CTRL+C is not working with java on latest cygwin 1.7.15
>> 
>> 
>> Thanks for the reply "K Stahl", but it didn't work for me. I ran the same
> Test,
>> then press CTRL+C. But the cygwin terminal did nothing. It did not stop
> the
>> java process, and it did not print any thing further. I must manually
> terminate
>> the process by going into Windows TaskManager.
>> 
>> Again, here is my cygwin version:
>> $ uname -srv
>> CYGWIN_NT-5.1 1.7.15(0.260/5/3) 2012-05-09 10:25
>> 
>> Am I on the latest version as you said? Did I miss any other config?
> 
> Actually, not so much on the latest version.  Did you try the most recent
> Cygwin snapshot?  Version 1.7.15 has some problems with hanging when
> running
> non-Cygwin programs but this was fixed in a later snapshot, perhaps this
> is
> related?
> 
> 
> --
> 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
> 
> 
> 


-----
----
Zemian Deng
-- 
View this message in context: http://old.nabble.com/CTRL%2BC-is-not-working-with-java-on-latest-cygwin-1.7.15-tp34147441p34153436.html
Sent from the Cygwin list mailing list archive at Nabble.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] 21+ messages in thread

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 18:47 CTRL+C is not working with java on latest cygwin 1.7.15 saltnlight5
  2012-07-11 19:18 ` K Stahl
@ 2012-07-12 21:57 ` saltnlight5
  1 sibling, 0 replies; 21+ messages in thread
From: saltnlight5 @ 2012-07-12 21:57 UTC (permalink / raw)
  To: cygwin


Okay, I finally found out what's going on.

I used to have an old cygwin installed (not even sure what version) that
only has "C:\Cygwin\Cygwin.bat" to start an terminal. This batch file open a
terminal that I can run java.exe, and I used to hit CTRL+C to end it (not
only that, it will also invoke the Java's shutdown hook.)

After I upgraded to cygwin 1.7.15-1 (it will auto upgrade when we run
setup.exe!). The above behavior no longer works!

It turns out the new cygwin 1.7.15-1 automatically comes with Mintty
terminal now, and will default to create a Shortcut to this on desktop. Well
I still have a shortcut to "C:\Cygwin\Cygwin.bat". What I discover is that
Java will no longer work with terminal that opens with
"C:\Cygwin\Cygwin.bat"! But it DOES work with the Mintty terminal! 

It's all great for me, because I kind of like Mintty terminal. It's kindda
funny because for years I would love to use Mintty, but only to stop because
CTRL+C wont' work there. Now we have reverse!

However, I have to point out also that although I can hit CTRL+C in mintty
to kill a java.exe process, but it DOES NOT invoke the Java's shutdown hook
process! Which is shame, because now I can't test my shutdown procedure
code.

I hope cygwin team can look at this further and provide a good solution,
even for the Java folks like myself. I can only cope with Windows because of
cygwin exists, so kudo to all the cygwin team and their hard work!

Hope also this post will help other Java developers out there.

Cheers,
Zemian
 

saltnlight5 wrote:
> 
> Hi there,
> 
> Before I upgraded cygwin, I used to be able to press CTRL+C to any java
> program, and it will trigger's shutdownhook and exit. But since I upgraded
> to latest cygwin, this is no longer working. Has anyone has this problem?
> 
> My cygwin version:
> $ uname -a
> CYGWIN_NT-5.1 L328BDS002023US 1.7.15(0.260/5/3) 2012-05-09 10:25 i686
> Cygwin
> 
> I did see an old post discussed the same thing, but I did not see a
> solution.
> http://cygwin.com/ml/cygwin/2012-05/msg00372.html
> 
> Can someone in the list help?
> 
> Thanks
> Zemian
> 


-----
----
Zemian Deng
-- 
View this message in context: http://old.nabble.com/CTRL%2BC-is-not-working-with-java-on-latest-cygwin-1.7.15-tp34147441p34153502.html
Sent from the Cygwin list mailing list archive at Nabble.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] 21+ messages in thread

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-07-11 20:07     ` saltnlight5
  2012-07-11 20:17       ` K Stahl
  2012-07-12 20:13       ` James Johnston
@ 2012-08-02 17:31       ` Roger K. Wells
  2012-12-12 10:05         ` erik56d
  2 siblings, 1 reply; 21+ messages in thread
From: Roger K. Wells @ 2012-08-02 17:31 UTC (permalink / raw)
  To: cygwin

On 07/11/2012 04:07 PM, saltnlight5 wrote:
> Thanks for the reply "K Stahl", but it didn't work for me. I ran the same
> Test, then press CTRL+C. But the cygwin terminal did nothing. It did not
> stop the java process, and it did not print any thing further. I must
> manually terminate the process by going into Windows TaskManager.
>
> Again, here is my cygwin version:
> $ uname -srv
> CYGWIN_NT-5.1 1.7.15(0.260/5/3) 2012-05-09 10:25
>
> Am I on the latest version as you said? Did I miss any other config?
>
> Thanks
> Zemian
>
>
> saltnlight5 wrote:
>> I do have the latest cygwin install. In fact I re-installed just today and
>> it's still not working.
>>
>> I printed the full version in my previous email. Was that not the lastest
>> cygwin version?
>>
>>
>> K Stahl wrote:
>>> Just tested with this against the latest release version (1.7.15) and
>>> everything works as expected.
>>>
>>> Example:
>>> public final class Test {
>>>      public static void main(String[] args) {
>>>          System.out.println("This shall hang until CTRL-C is pressed...");
>>>          for (;;);
>>>      }
>>> }
>>>
>>> javac -cp . Test.java
>>> java -cp . Test
>>>
>>> Press CTRL-C and you are returned to the terminal.
>>>
>>> --
>>> 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
>>>
>>>
>>>
>>
>
> -----
> ----
> Zemian Deng
This is still a problem.
CYGWIN_NT-6.1 rwells-w7 1.7.16(0.262/5/3) 2012-07-20 22:55 i686 Cygwin

We have been developing CLI applications for close to 20 years and have 
never had a
problem with the cygwin bash shell failing to pass Ctrl-C signals to the 
application until now.
Luckily the cmd.exe still does.

Let me know if it something that I can help track down.  Glad to help if 
possible.


-- 
Roger Wells, P.E.
SAIC
221 Third St
Newport, RI 02840
401-847-4210 (voice)
401-849-1585 (fax)
roger.k.wells@saic.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] 21+ messages in thread

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-08-02 17:31       ` Roger K. Wells
@ 2012-12-12 10:05         ` erik56d
  2012-12-12 14:06           ` Aaron Schneider
  0 siblings, 1 reply; 21+ messages in thread
From: erik56d @ 2012-12-12 10:05 UTC (permalink / raw)
  To: cygwin

Hi,
being a long-time CygWin fan among Windows users, I was a bit frustrated
when I had to revert to cmd.exe in order to have the ShutDown hook in my
Java program executed on pressing CTRL-C.

So, it seems the problem with CTRL-C still persists?
Or, is there a solution?

I'm running X, i.e. starting Cygwin by

C:\cygwin\bin\rxvt.exe --backspacekey '^h' -g 100x30 -ls -sl 2046 -tn xterm
-title "Local PC" -e /usr/bin/bash --login -i %HOME%/bin/X.sh

where X.sh contains

export DISPLAY=":0.0"
Xwin -clipboard &
sleep 10
wmaker &
wait

and my CygWin version is

$uname -a
CYGWIN_NT-5.1 mypc 1.7.17(0.262/5/3) 2012-10-19 14:39 i686 Cygwin

Regards,
Erik



--
View this message in context: http://cygwin.1069669.n5.nabble.com/CTRL-C-is-not-working-with-java-on-latest-cygwin-1-7-15-tp63179p94866.html
Sent from the Cygwin list mailing list archive at Nabble.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] 21+ messages in thread

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-12-12 10:05         ` erik56d
@ 2012-12-12 14:06           ` Aaron Schneider
  2012-12-12 17:26             ` erik56d
  0 siblings, 1 reply; 21+ messages in thread
From: Aaron Schneider @ 2012-12-12 14:06 UTC (permalink / raw)
  To: cygwin

On 12/12/2012 11:05, erik56d wrote:
> Hi,
> being a long-time CygWin fan among Windows users, I was a bit frustrated
> when I had to revert to cmd.exe in order to have the ShutDown hook in my
> Java program executed on pressing CTRL-C.
>
> So, it seems the problem with CTRL-C still persists?
> Or, is there a solution?
>
> I'm running X, i.e. starting Cygwin by
>
> C:\cygwin\bin\rxvt.exe --backspacekey '^h' -g 100x30 -ls -sl 2046 -tn xterm
> -title "Local PC" -e /usr/bin/bash --login -i %HOME%/bin/X.sh
>
> where X.sh contains
>
> export DISPLAY=":0.0"
> Xwin -clipboard &
> sleep 10
> wmaker &
> wait
>
> and my CygWin version is
>
> $uname -a
> CYGWIN_NT-5.1 mypc 1.7.17(0.262/5/3) 2012-10-19 14:39 i686 Cygwin

What java program is that? Can you put a link to it or to any other that 
produces the issue?


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

* Re: CTRL+C is not working with java on latest cygwin 1.7.15
  2012-12-12 14:06           ` Aaron Schneider
@ 2012-12-12 17:26             ` erik56d
  0 siblings, 0 replies; 21+ messages in thread
From: erik56d @ 2012-12-12 17:26 UTC (permalink / raw)
  To: cygwin

There is nothing special about the Java program. Might be e.g. 
public class ShutdownHookTester
{
  public static void main(String[] args) {
    Runtime.getRuntime().addShutdownHook(new Thread()
    {
      public void run() {
        System.out.println("Cleaning up");
      }
    });
    for (int i=0;i<10000;i++)
    {
      System.out.print(".");
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e) {
      }
    }
  }
}

When run under CygWin, pressing CTRL-C will just give you your shell prompt:
$java -cp target/other-utils-1.0.jar com.edb.bds.util.ShutdownHookTester
...
$
Run from cmd.exe, however, the Shutdown Hook is executed as it should be,
yielding:
C:\java -cp . com.edb.bds.util.ShutdownHookTester
....Cleaning up
C:\




--
View this message in context: http://cygwin.1069669.n5.nabble.com/CTRL-C-is-not-working-with-java-on-latest-cygwin-1-7-15-tp63179p94878.html
Sent from the Cygwin list mailing list archive at Nabble.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] 21+ messages in thread

end of thread, other threads:[~2012-12-12 17:26 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-11 18:47 CTRL+C is not working with java on latest cygwin 1.7.15 saltnlight5
2012-07-11 19:18 ` K Stahl
     [not found]   ` <1355306723156-63181.post@n5.nabble.com>
2012-07-11 19:55   ` saltnlight5
2012-07-11 20:06     ` K Stahl
2012-07-11 20:07     ` saltnlight5
2012-07-11 20:17       ` K Stahl
2012-07-11 20:26         ` saltnlight5
2012-07-11 20:34           ` K Stahl
2012-07-11 20:37             ` K Stahl
2012-07-12  1:40             ` Earnie Boyd
2012-07-12 13:02               ` saltnlight5
2012-07-12 13:23                 ` K Stahl
2012-07-12 15:39                 ` Earnie Boyd
2012-07-12 20:13       ` James Johnston
2012-07-12 21:39         ` saltnlight5
2012-08-02 17:31       ` Roger K. Wells
2012-12-12 10:05         ` erik56d
2012-12-12 14:06           ` Aaron Schneider
2012-12-12 17:26             ` erik56d
2012-07-12 14:24   ` Aaron Schneider
2012-07-12 21:57 ` saltnlight5

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