public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: erik56d <erik56d@gmail.com>
To: cygwin@cygwin.com
Subject: Re: CTRL+C is not working with java on latest cygwin 1.7.15
Date: Wed, 12 Dec 2012 17:26:00 -0000	[thread overview]
Message-ID: <1355333165623-94878.post@n5.nabble.com> (raw)
In-Reply-To: <BLU0-SMTP84523E7025AAAA0A7CB05ECE4F0@phx.gbl>

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

  reply	other threads:[~2012-12-12 17:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 18:47 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 [this message]
2012-07-12 14:24   ` Aaron Schneider
2012-07-12 21:57 ` saltnlight5

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355333165623-94878.post@n5.nabble.com \
    --to=erik56d@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).