Command Line

Command Line
TeSSH has a Command Line separate from the main server window.  This Command Line can be used for client-side editing, tab completion, command history, and spell checking.  You can easily toggle between the command line and the main window using Shift-Tab.  Scripting commands can also be executed directly on this Command Line.

In most Telnet and SSH clients, you enter text directly into the main server window.  This causes each key stroke to be sent to the server and echoed back to the screen in return.  On slower network connections, this round-trip time to display each key stroke can cause lag and reduce editing efficiency.  By typing your command into the separate Command Line, you can use local editing and then press Enter to send the entire line to the server at once.  This is known as "Line Mode".

Most remote shells provide editing (using the backspace key, left and right arrows), tab completion (pressing Tab to autocomplete a file path) and command history (pressing up and down arrow to recall previous commands).  TeSSH replicates those features within the Command Line and adds additional features such as Spell Checking.

Command Editing

When typing on the command line, you can use the <Backspace> key to remove the last character or you can move the insertion point within the command line by clicking with the mouse. If you have a separate set of arrow keys on your keyboard, you can use the right and left arrow to move within the command line or ctrl-left and ctrl-right to move to the next word in the command. Note that the keys on the numeric keypad might have macros assigned to them so they cannot be used as arrow keys unless the NumLock mode is deactivated on your keyboard.  When you press <Enter>, the text in the command line is sent to the server. If the Echo Command preference is enabled, it will also be displayed in the main server window.

You can enter multiple commands on the same line using the Separator character, which defaults to semi-colon (;). Thus, "cd ..;ls" will send the two commands "cd .." and "ls" to the server in quick succession.

The command line can contain more than one line at a time. As you type, the text will automatically word-wrap at the right-edge of the line and the command line will expand to show the entire text string. Note that even though the text is displayed on a multiple lines, it is still considered one line by server and will be sent to the server as a single line. To add an actual second line, press Shift-Enter to force a hard new-line in the command. This works just like the command separator character. To clear the line, press the ESC key. You can turn off the word-wrap setting in the Preferences.

To toggle between using the Command Line and typing into the main server window, use the Shift-Tab key.

Command History

Commands that you send to the MUD are stored in your Command History. With the cursor on the first line of the command line, press UP-Arrow to recall the last command you entered. Press UP-Arrow again to recall the previous command, and so on. If the cursor is in the last line of the command line, pressing Down-arrow will move the opposite direction through the command history. Or, if you have started typing a command, pressing Down-arrow will store the command in the command history without sending it. 

This Down-arrow "save" feature is very useful if you are in the middle of typing a long message and you need to do something else on the server quickly. Just press Down-arrow to save your command in the command buffer without sending it, then type the command you need to send to the server quickly and press Enter. Now that the command has been sent, press Up-arrow to retrieve your long message and continue working on it, and press Enter when you are ready to send it to the server.

You can also click on the small drop-down arrow to the right of the command line field to display a popup list of your command history.  Or you can press Ctrl-H to see the command history in a separate window.

Tab Completion

When typing into the main server window, each key is sent to the server as you type and the server responds to those key presses.  So the function of each key press depends upon what remote shell you are using or what remote application you are using.  For example, pressing the <Backspace> key might have a different function on the main server command shell compared to pressing it within a editor program such as "vim". 

Most command shells support "tab completion" of file directory paths.  For example, if you enter "cd /bi" and press Tab, the shell will often automatically add the matching path text and will display "cd /bin/"

The Command Line in TeSSH supports a similar feature.  If the "Use remote tab completion" preference is enabled, then pressing Tab on the command line will work exactly the same as within the shell as long as you are still at the shell prompt on the server.  Otherwise, additional local tab completion features are also available.  When you press Tab, TeSSH will first try to auto-complete your command using text displayed in the main server window.  It will also check any predefined terms you might have added to your session tab completion word list.

If you press the Up-arrow instead of Tab, TeSSH will attempt to find a command in your history that begins with the text you have already typed.

Context-sensitive Help

If you enter the name of a scripting #command or %function on the command line and then press F1, a Reference popup will be displayed with more help about the command or function.  Within this Reference window you can click the "More Help" link to open the full help file for the topic.  You can also view the quick reference of other commands and functions using the drop-down list in the reference window.

Command Line Scripts

Before the command line is sent to the server, it is parsed for any scripting commands.  If a script command is encountered, it is executed instead of sending the line to the server.  For example, if you type

#ECHO "hello"

on the command line and press Enter, the text "hello" will be displayed on the screen but no text will be sent to the server.

To prevent the execution of a script and to force the text in the command line to be sent to the server verbatim, you can either toggle the command line Parsing option off and on using the Ctrl-R key (or click the icon of the computer to the right of the command line).  Or you can start your command line with the ` character, which is the "line escape" character that causes the following line to be treated as plain text.  The ~ character can also be used to escape individual characters, such as the # character to prevent it from being parsed as a command.

Normally the command line will parse zScript commands.  To put the command line into "Lua" mode, press the Ctrl-` key.  While in Lua mode, the text on the command line will be parsed and executed as a Lua scripting command.  While in Lua mode, you will not be able to send any commands or text to the server.

Add comment

Login or register to post comments