RFR: JDK-8173653: jshell tool: ctrl-C when in external editor aborts jshell -- history lost

Jan Lahoda jan.lahoda at oracle.com
Fri Feb 3 21:13:19 UTC 2017


Hi,

When an external editor is running, the terminal is switched back to the 
original mode, mostly so that we can detect if the external editor is a 
terminal editor or not (terminal editors switch the terminal to raw 
mode). But this means that the normal Ctrl-C functionality is restored, 
and so pressing Ctrl-C in JShell kills it.

The proposed patch is to disable the normal Ctrl-C functionality while 
running the external editor. Ctrl-C will be placed into the System.in as 
any other input. The patch also fixes behavior with terminal editors on 
Windows, by detecting them (when JShell detects a terminal editor, it 
won't recompile the snippets while the editor is running, as it would 
distort the editor).

Needs a tiny change to jdk.internal.le, I'll see if I can get something 
along these lines to the upstream.

langtools repository changes:
http://cr.openjdk.java.net/~jlahoda/8173653/langtools.00/
jdk repository changes:
http://cr.openjdk.java.net/~jlahoda/8173653/jdk.00/
Bug:
https://bugs.openjdk.java.net/browse/JDK-8173653

Any feedback is welcome.

Thanks,
    Jan


More information about the kulla-dev mailing list