Title: Windows only CTRL-C no longer works since Jython 2.5.2
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.7, Jython 2.5
Status: open Resolution:
Dependencies: Superseder:
Assigned To: amak Nosy List: amak, clach04, fwierzbicki, wfouche
Priority: normal Keywords: console

Created on 2012-08-10.20:46:54 by clach04, last changed 2014-09-08.19:37:31 by wfouche.

msg7375 (view) Author: Chris Clark (clach04) Date: 2012-08-10.20:46:53
CTRL-C works fine under Linux (well there are other bugs which are NOT related to this, issue1313 and issue1270). Under Windows CTRL-C does not work and the only way to stop Jython is to kill the JVM (java.exe) in the TaskManager.

Problem does not exist in 2.5.1.

Problem exists in 2.5.2 and 2.5.3 (beta and rc1).

Test caes:

    java.exe -jar  jython.jar -m SimpleHTTPServer

Then issue CTRL-C to quit.

More background
msg7404 (view) Author: Alan Kennedy (amak) Date: 2012-08-14.21:42:43
I think that this is to do with the JLineConsole.

If you change the "python.console" property in the registry file to "org.python.util.InteractiveConsole", i.e


The ctrl-c starts working fine.

If you leave it at the default JLine console ( then ctrl-c seems to get treated as a normal character (shows up as a heart symbol on my windows command line).

I suggest you try a different console class until this is fixed.

I'll look into how we can address this.
msg7410 (view) Author: Chris Clark (clach04) Date: 2012-08-15.15:53:53
Awesome research/workaround!


    java.exe -Dpython.console=org.python.util.InteractiveConsole -jar jython.jar -m SimpleHTTPServer

now works with 2.5.2 and 2.5.3.

The other test case:

    java -jar jython.jar

Shows CTRL-C as a heart symbol (when chcp = 437), and the workaround of:

    java -Dpython.console=org.python.util.InteractiveConsole -jar jython.jar

means CTRL-C quits like it used to (and does for CPython).

BTW 2.5.3 isn't a valid version to report bugs on.
msg7411 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-08-15.17:32:22
Yeah - sorry about 2.5.3 not being in Versions - something is wrong with our Roundup instance such that it isn't allowing me to add one.
msg7453 (view) Author: Joey Jarosz ( Date: 2012-09-06.15:15:25
I have also discovered that the builtin "input()" command does not work in 2.5.2 nor 2.5.3. The workaround of using the InteractiveConsole class does solve this problem as well as the original complaint.
msg7704 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2013-02-19.21:41:48
Going through and fixing versions now.
msg8970 (view) Author: wfouche (wfouche) Date: 2014-09-08.07:15:42
On Windows using the recently released Jython 2.7b3, Ctrl-C does not terminate a running script; on Linux it works fine. Ctrl-C works as expected with Jython 2.5.4rc1 on Windows.
msg8973 (view) Author: wfouche (wfouche) Date: 2014-09-08.19:37:31
The workaround for previous versions of Jython to get Ctrl-c to work on Windows, adding runtime option -Dpython.console=org.python.util.InteractiveConsole, does not work with Jython 2.7b3; it produces the following error:

console: Failed to install 'org.python.util.InteractiveConsole': does not implement interface org.python.core.Console.
Date User Action Args
2014-09-08 19:37:31wfouchesetmessages: + msg8973
2014-09-08 07:15:42wfouchesetnosy: + wfouche
messages: + msg8970
2013-02-26 18:03:50joey@cadence.comsetnosy: -
2013-02-25 22:01:20amaksetkeywords: + console
2013-02-19 21:41:48fwierzbickisetpriority: normal
messages: + msg7704
versions: + Jython 2.5, Jython 2.7, - 2.5.2, 2.5.3b1, 2.5.3b2
2012-09-06 15:15:26joey@cadence.comsetnosy: +
messages: + msg7453
2012-08-15 17:32:23fwierzbickisetmessages: + msg7411
2012-08-15 15:53:53clach04setmessages: + msg7410
2012-08-14 21:42:44amaksetassignee: amak
messages: + msg7404
nosy: + amak
2012-08-14 03:23:48fwierzbickisetnosy: + fwierzbicki
2012-08-10 20:46:54clach04create