This plugin is designed to allow you to easily compile files you are editing remotely via sftp:// and parse the errors for ErrorList. It has no user interface of its own, because it is an extension of three other plugins: Console, FTP, and ErrorList, and uses a docked jEdit File System Browser for navigation.
Console provides jEdit with a dockable command line interface to the System Shell and the BeanShell, and an open interface for adding new shells. SshConsole adds a jEdit Shell Service to Console called ssh.
Console parses the output of the commands through its own error parsers which are configurable from Plugin Options - Console - Error Parsers. When Console adds detected errors to the ErrorList dockable, you can click on the error, and jEdit will open the remote file for you if necessary, and position your caret at the error location.
The FTP plugin defines a virtual file system (VFS) called "sftp://", which allows the user to make secure sftp:// connections to remote hosts, and browse their file systems using jEdit's File System Browser, also known as FSB or VFSBrowser. At any time, the user can select, and then manipulate selected files from the FSB or jEdit. Since the FTP plugin handles prompting and remembering username/passwords, the SshConsole plugin assumes you want to ssh into the same host using the same port and creds as the most recent sftp:// connection in that View's FSB (or its currently editing buffer, if it is open to a file on a remote host via sftp).
Initially, the SshConsole does not know where to connect. You will see a prompt like this:
[no sftp:// connections?] >
At this point, any commands you type will be ignored. To tell the plugin to connect somewhere, you need to do one of these things:
Here are instructions for first-time users:
If later, you use the FSB to connect to a different remote sftp host, then the next time you use the SshConsole, it should logout of the old ssh session, create a new shell connection to the same host you just logged into via sftp, and send your shell commands there.
[1] Alternately, you can use Plugins - Console - Shells - Ssh, or open a Console and select ssh from the Shells combobox.
Sending Ctrl-D (EOF), or Ctrl-Z (DETACH), work the way you would expect them to on a unix shell. To send a Ctrl-C, click on the "X" button in the Console pane (Ctrl-C is still a "copy to clipboard" shortcut). Other control keys typed during the execution of your program are not sent to the remote host. Let me know if you need one of them to be.
The following built-in commands which work in the System shell also work in the ssh shell:
Sometimes an ssh connection will timeout while you are using the SshConsole. If this happens, you will see an IOException in your activity log when you attempt to execute the next command. At this point, the console should automatically close its existing connection and open a new one when you enter the next command.
It may be necessary to click again on a remote file in the FSB, to remind the SshConsole where to connect.
If for some reason, after a timeout, your SshConsole is non-responsive, you can explicitly close all open connections from the Plugins - SshConsole - Close Connections menu action. This has the effect of restarting the plugin from scratch, so again, you will need to navigate to a remote file via the FSB so that SshConsole knows where to send your commands.
These are things I'd like to have in this plugin at some point. Volunteers?
Enjoy! This is free software, released under the GPL V2. Feel free to contribute to it (or other plugins) too, by joining the jedit-devel@lists.sourceforge.net mailing list and submitting patches or suggestions.