JShell tool: remove or keep default Edit Pad editor?

Robert Field robert.field at oracle.com
Mon Oct 10 20:22:43 UTC 2016


Within the jshell tool, you can type:

     /edit foo

or

     /edit

To edit a specific snippet or all active snippets.

If no external editor is specified in the jshell tool with:

     /set editor myfavoriteeditor

then a built-in default editor "Edit Pad" is used.

There are several reasons Edit Pad is there:

* So that the jshell tool works out-of-the-box.  Particularly for 
newbies it is important that they can use jshell without configuring it.

* So that jshell can be platform-neutral.  There is no editor that would 
work on every platform -- or even any configuration of a platform.  This 
is an issue for documentation.

* Because of interaction issues, including potentially needed flags, 
set-up of an external editor can be error prone.  The external editor 
launch may need options set.  If the editor returns immediately 
(sometimes or always) the jshell editor setting -wait should be used.

* For newbies where the barrier to entry should be low, the challenges 
of learning an editor can be an issue.  The Edit Pad is as simple as 
possible.

There are however also many drawbacks to having the built-in editor:

* It is a module anomaly to reference Desktop from core JDK tools.

* Part of the definition of the jshell tool is that it is a command line 
tool.  The Edit Pad is not command-line.

* The Edit Pad functionality is a slippery-slope.  There have already 
been requests for additional functionality -- on several fronts: 
interaction with jshell, more general editing functionality, and more 
Java-specific functionality.

* The existence of a separate window in the jshell tool is a 
slippery-slope.  There have already been requests for windows for I/O 
(both for clarity of separating commands from output and to address 
issues of interaction between command input and program input) and 
requests for windows with active variable values, etc.

* The core JDK tools team does not have UI design as a core competency,

We would very much like your input on this issue.  A (motivated) 
thumbs-up/down are interesting.  Alternative suggestions on addressing 
this are very interesting.

Thanks,
Robert et. al.




More information about the kulla-dev mailing list