I have an SWT based console that is working.  In order to be able to execute SWT code from the interpreter I have to execute the code in the display thread which isn't the thread that the interpreter is running in.  So instead of evaluating the user input directly I have to wrap it in a call to display.syncExec().  I had a version of this working but I'm trying to clean up the code and I'm now running into a few problems.  In order to execute the user commands I have a method as follows:

runInDisplay(command) {
    super._swtcommand = command; //bit of a hack to get around namespace change


    run () {



The scenario I'm running is the user inputs "shell = new Shell(display);".  This executes fine but the next time this method is invoked shell == void.  It doesn't seem to be storing any user created variables in the global namespace which should be this.caller.namespace.  If the user inputs "shell = new Shell(display);shell.open();" a shell opens so at least I know it will work.

I feel like I'm missing something obvious and hopefully someone can straighten me out.