cbuschka / beanshell2

Automatically exported from code.google.com/p/beanshell2
0 stars 0 forks source link

Implement Libedit/Readline support for CLI beanshell instances #52

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Would it be possible to implement one of the various Readline/libedit wrappers 
in the command line version of beanshell? When using beanshell as an 
interactive Java interpreter, the lack of typical shell functionality such as 
command history is extremely frustrating.

There is a patch to beanshell included in the Java-readline 
(http://java-readline.sourceforge.net/) project's source archive that 
implements this functionality using their package. That could be used as a 
starting point for this feature request.

Original issue reported on code.google.com by jml...@gmail.com on 25 Sep 2011 at 8:07

GoogleCodeExporter commented 9 years ago
That's easily done with jline. You can download the jar from: 
http://jline.sourceforge.net/index.html

I assume you put your jars in /opt/lib. Run:

java -cp /opt/lib/jline.jar:/opt/lib/bsh-2.1b5.jar jline.ConsoleRunner 
bsh.Interpreter

Voila! Beanshell with readline capabilities ;-)

Original comment by lyderic....@gmail.com on 29 May 2012 at 1:31

GoogleCodeExporter commented 9 years ago
Interesting. Thanks for the reply. I'll give this a shot.

Any reason this functionality should not be bundle with BeanShell by default? 
Seems like a necessary feature, given the expectations created by the average 
REPL and interactive interpreters.

Original comment by jml...@gmail.com on 29 May 2012 at 1:34

GoogleCodeExporter commented 9 years ago
Well I guess many people don't run Beanshell in interactive mode (I don't), so 
it is no use to bloat the jar...

Personally, I would prefer to keep it the way it is now.

Original comment by lyderic....@gmail.com on 29 May 2012 at 2:12

GoogleCodeExporter commented 9 years ago
Fair enough.

Thanks for the replies.

Original comment by jml...@gmail.com on 29 May 2012 at 2:22