This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: CTRL+C is not working with java on latest cygwin 1.7.15
- From: erik56d <erik56d at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 12 Dec 2012 09:26:05 -0800 (PST)
- Subject: Re: CTRL+C is not working with java on latest cygwin 1.7.15
- References: <1355306723154-63179.post@n5.nabble.com> <CAMK_jUXuu9Bmwurx733P3kV4EevCpens5ESnsP6EcRAWbxiBFQ@mail.gmail.com> <1355306723156-63181.post@n5.nabble.com> <1355306723157-63182.post@n5.nabble.com> <501AB915.5050106@saic.com> <1355306723094-94866.post@n5.nabble.com> <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