Location: Main / Documentation / FAQ Language: en


How do I evaluate an expression/statement/...?

Hit CTRL-ALT-ENTER to evaluate code inside a Region. A Region is code that is grouped when you first use this keyboard shortcut. You can then re-evaluate this group by hitting this keyboard shortcut again. You can also edit the code just like in any other editor.

What are these “Connect To”/”Disconnect” actions in the context menu?

Every launched EclipseShell is backed by a language interpreter (called EclipseShell Execution Environment). The default action on closing the EclipseShell editor is to shutdown the Execution Environment behind it. In some cases you might not want that, so you can “Disconnect” from the Execution Environment; if you then close the editor, the Execution Environment will continue running. You can later on work with the Execution Environment by opening an Eclipse Shell editor and using “Connect To” to connect to the Execution Environment.

But… why would I want to disconnect from an EclipseShell Execution Environment?

Think of this feature as an equivalent of Unix Job control, where you can put a process in the background and later on get it back to the foreground. This can be useful if you want to write some little script that does something actively in the background, eg. wake up every minute to poll a server, wake up every 15 minutes to tell you about the dangers of RSI, etc. With the Connect/Disconnect feature, you can have that even if you do a “Close All”.

Contributing to EclipseShell?

OK, maybe you can ignore the last two items, but the first item is essential. Currently I don’t plan to add 3rd party developers to the team. It’d be most useful to add additional languages to the available mix. As this is possible by writing a plugin, you can do this on your own. Still, use the mailing list for coordination, so the world doesn’t end up with 15 EclipseShell Execution Environments for the COW language and none for [your favourite language].

Oh… for details head over to the Developer area of this website

What’s with the odd syntax highlighting?

Well, you see: there’s a place to contribute. The syntax highlighting I set up for Beanshell and JRuby is very, very basic and primitive. This can be seen by entering “print” into an EclipseShell editor used with Beanshell, you should see “print”. The reason is that my syntax highlighting mode currently onle looks for certain strings (guess why it highlights “int”). I’ll fix this when I get around to, or if someone provides a patch.

What are there two run modes for JRuby and Beanshell, one “eclipse” one called “externalDebug”?

The “eclipse” run mode means: the Java language runtimes (JRuby, Beanshell,...) will be instantiated inside the same JVM as Eclipse. This has certain benefits (being able to script Eclipse plugins, ...), but of course some problems (if your scripting code goes crazy , you have no way of just killing the process, but you’ll have to kill the with both Eclipse and your code; of course, if your script calls System.exit() or causes the JVM to fail in some other way, you’re screwed too).

The solution for this is the “externalDebug” mode, which launches a new JVM process (using the Eclipse Java Launch system) and starts the runtime for your language in that new runtime. The connection between Eclipse and the new JVM currently works via RMI (the new JVM listens on a localhost port and EclipseShell connects to it). This mode also has the benefit that the language runtime is launched in Debug mode, so you can just switch to the Debug perspective and mess with the Java process in the Java Debugger.

“eclipse” and “externalDebug” modes work differently in the way they deal with results from evaluated expressions. The “eclipse” mode shows them in the console by default, the “externalDebug” mode doesn’t, instead you’ll have to print the results you want to stdout yourself. (this is easy in JRuby: just prepend the “p” method call; in Beanshell, simply wrap the expressions in “print()”).