|
From: John G. <jge...@ny...> - 2001-08-20 01:35:09
|
A patch is attached to deal with the following: - Windows built-ins now called with "command.com" or "cmd.exe" (hard-coded extensions) - "set" added to Windows built-ins (called without parameters, it dumps the environment) - "cd" SystemShell built-in fixed (bad vector index changed from 1 to 0) - Exception from execute() rethrows exception wrapped inside InvocationTargetException if one exists - default extensionsToTry supplied when Windows environment does not contain PATHEXT (default on Win95/98/Me) - output.commandDone() called in ConsoleProcess.stop() to stop the cute little fish after abnormal termination of process. The BeanShell shell looks OK to me; I'm delighted to have it back. Here's a short dump: This shell evaluates commands in jEdit's BeanShell interpreter. For example, try evaluating "2+2". The current console instance is stored in the BeanShell variable "console". > 2+2 4 > jEdit.getSettingsDirectory() C:\WINNT\Profiles\Administrator\.jedit > console.run(console.Shell.getShell("System"), console, "dir"); > dir <<<<<< output by Console/SystemShell Volume in drive G has no label. Volume Serial Number is 3E60-3EBD Directory of G:\Program Files\jEdit 08/02/2001 05:40p <DIR> . 08/02/2001 05:40p <DIR> .. 08/02/2001 05:40p <DIR> jars 08/01/2001 11:53a 573 test.vbs 07/18/2001 08:49p 338 test.js [balance of output deleted] The macros in the Console jar don't work because they pass a String to Console.setShell() instead of a Shell. I fixed that and put the common code in a implementation method. I also thought a simple wrapper method to execute a command in the SystemShell would be helpful. The result is a modified Console.bsh which is also attached. Instead of this approach to Console macros, if you predefined "systemShell" along with "console" and added a pair of wrapper methods to the Console class, you would enable macro syntax like this: console.runCommand(systemShell, "mycommand"); console.runCommandInBuffer(systemShell, "mycommand"); This seems to me to be much easier to work with. It should also run faster because it use more compiled code. Then JCompiler could predefine "compilerShell", and so on. I haven't looked closely at commando yet, but these items should get the system shell in shape for release. John |