RFR: JDK-8080679: Include jline in JDK for Java and JavaScript REPLs

Jan Lahoda jan.lahoda at oracle.com
Wed Jul 1 15:58:57 UTC 2015


On 1.7.2015 16:43, Alan Bateman wrote:
>
>
> On 30/06/2015 16:05, Jan Lahoda wrote:
>>
>> We need to override these "settings" for jshell (we use subclasses of
>> WindowsTerminal/UnixTerminal to get e.g. Ctrl-C detection - not sure
>> if we will want to generalize these additional features for jjs as
>> well). Is there a way to override them (just) for jshell using
>> ServiceLoader?
> Is extending these classes the normal way to customize? That makes it
> really awkward to cleanly separate the multiple implementations.

Subclassing is used in JLine (there's for example 
NoInterruptUnixTerminal which is a subclass of UnixTerminal). We could 
use delegation for some of our purposes, but so far it seems we need to 
be able to use customized Terminals instead of the original ones, as 
e.g. WindowsTerminal is synthesizing an InputStream (which is then used 
instead of System.in) which we are intercepting and continuously reading 
from it awaiting Ctrl-C (when the user's code is running, Ctrl-C will 
interrupt it).

>
> BTW: I think what you in the current webrev is okay for now.

Thanks!

Jan

>
> -Alan



More information about the core-libs-dev mailing list