Console Plugin |
By Slava Pestov
slava@jedit.org |
General Information
The Console Shell
The BeanShell
Using Other Shells
The Console Tool Bar
Change Log
General Information
The console plugin allows the user to run commands in various
available shells. The default console shell runs
system processes (such as programs, compilers, etc). The BeanShell
runs commands in jEdit's BeanShell interpreter. Some plugins such as
JCompiler add their own shells which perform other tasks.
A console can be opened by selecting Plugins>Console.
The console window can be set to dock into the view in
Utilities>Global Options>Docking.
The console consists of a shell selection combo box, a text field for
entering commands, and an output area.
Pressing ENTER in the command field will execute the
currently entered command. Previously entered strings can be recalled
with the UP and DOWN keys.
Entering the `clear' command in any shell will remove all text from the
output area.
Tip: if you find yourself executing the same console command frequently,
record it in a macro. Simply enter the command in the console while a
macro recording is in progress.
The Console Shell
The console shell runs operating system commands.
To use it, select Console from the popup menu to the right of the
command text field.
The default shell understands the following variables as part of a command:
- ~ - expands to the user's home directory
- $d - expands to the current file's parent directory
- $f - expands to the current file's full path
- $u - expands to the current file's URL (file: is prepended if it is
a local file)
- $j - expands to the directory where jEdit is installed
- $n - expands to the current file's name, without the trailing extension,
if any
- $$ - expands to the $ character
The default shell also parses command output for compiler errors. A number
of different formats are supported, and new error patterns can be added
in Utilities>Global Options>Console. Parsed errors
are added to the error list, which can be viewed by invoking
Plugins>Error List (if you do not see that menu item, then
you need to install the ErrorList plugin).
When running on Java 1.3 or later, the working directory from which commands
are executed can be changed with the "cd" command.
To display the current working directory, use the "pwd" command.
The BeanShell
The BeanShell runs commands in jEdit's BeanShell interpreter.
To use it, select BeanShell from the popup menu to the right of the
command text field.
Using Other Shells
A few other plugins define shells of their own; JCompiler, for example.
To use an alternative shell, select it from the shell popup
in the console window.
The Console Tool Bar
If enabled in Utilities>Global Options>Console,
the console will add a tool bar to each view allowing quick and easy
command invocation.
Change Log
Version 2.4.5
Requires EditBus 0.10 and jEdit 3.0pre5.
- Ant error pattern added
- We now check if the new form of the exec() method exists, regardless
of the Java version. This should fix the problems that were reported with
1.3 VMs that report themselves as 1.2.
- Console help didn't appear in help index
Version 2.4.4
Requires EditBus 0.10 and jEdit 3.0pre5.
- More DOS built-in commands recognized
- Fix for invocation of DOS builtins with command-line arguments
- Bug fix: console variables should now work in "cd". Really this time
Version 2.4.3
Requires EditBus 0.10 and jEdit 3.0pre5.
- Bug fix: console variables ($d, $f, and so on) were not being expanded in
"cd" commands
- Enhancement: VHDL error messages are now recognized (Dante Fabrizio)
Version 2.4.2
Requires EditBus 0.10 and jEdit 3.0pre5.
- Fixed wrong version property causing ConsolePlugin
to reappear again and again on PluginManager->update (Dirk Moebius)
Version 2.4.1
Requires EditBus 0.10 and jEdit 3.0pre5.
- Built-in shell commands (copy, del, dir, and so on) can now be executed
on Windows (John Gellene)
- Fixed code flow problem in DefaultShell.java (John Gellene)
- The default shell now tries to execute .cmd files, in addition to .bat and
.exe
Version 2.4
Requires EditBus 0.10 and jEdit 3.0pre5.
- "BeanShell" shell added
- Recording console commands in macros supported again
- Error parsing didn't take changing directories into account, and as a result
errors would point to the incorrect path after a "cd" command
- When running on Windows or OS/2, the console first tries appending ".bat" to
the command name. If that fails, it tries appending ".exe".
Version 2.3.1
Requires EditBus 0.10 and jEdit 2.6pre5.
- Fixed a race condition between the stdout and stderr threads
- Because the macro recording API has changed between jEdit 2.6 and 2.7,
recording support in the console has been disabled temporarily to preserve
compatibility with both jEdit versions. It will be re-enabled as soon as
2.7final is released
Version 2.3
Requires EditBus 0.10 and jEdit 2.6pre5.
- 'Stop' button added to console window
- "cd" command now supported on Java 1.3 and later
- Removed call to deprecated
MiscUtilities.getFileParent()
method; Console now requires jEdit 2.6pre5 or later
Version 2.2
Requires EditBus 0.9.4 and jEdit 2.6pre3.
- Uses jEdit 2.6pre3 window docking API
Version 2.1.3
Requires EditBus 0.9.4 and jEdit 2.5.1.
- Option pane fixed to work with jEdit 2.6pre2
- Compiler error pattern for Microsoft Visual C++ added
Version 2.1.2
Requires EditBus 0.9.2 and jEdit 2.5pre1.
- Another compatibility fix for 2.5pre1
- Fixed another option pane bug
Version 2.1.1
Requires EditBus 0.9.2 and jEdit 2.4.2.
- Compatibility fixes for upcoming jEdit 2.5pre1
- Fixed minor console option pane bug
Version 2.1
Requires EditBus 0.9.2 and jEdit 2.4pre6.
- Error patterns can now be changed in the option pane
- Commands invoked through the "console" action (eg, in macros) are now
added to the history
- Updated for new option pane API
- Updated to use jEdit.get/setBooleanProperty() for boolean properties
Version 2.0.2
Requires EditBus 0.9 and jEdit 2.2pre3.
Version 2.0.1
Requires EditBus 0.9 and jEdit 2.3pre3.
- Console geometry was not being saved
Version 2.0
Requires EditBus 0.9 and jEdit 2.3pre3. This is a complete rewrite that
has an enhanced user interface, customizable error parsing, and many other
improvements.