Patch for making L-gui to work properly in interactive mode

Yes, the crash occurred both ways, but went away once I moved the Tcl_SetVar.

I don’t think this patch will fix the graphical Tk console though, which comes up when you double-click on the L-gui app in Finder under OS X. I haven’t been in that code before, but it looks like it’s handled by Tcl code in tk/library/console.tcl and not the loop in Tk_Main which is an interactive mode via stdin (not available on Windows).

I was able to get a Windows build (have you seen Building on Windows ? those directions should still apply except that we’ve already patched the source code so you shouldn’t have to do that part if you have the latest tree). Running L-gui on Windows also brings up the graphical Tk console. So I suppose a full solution would need some more changes. I’ll have a look at console.tcl later.