Legacy Communication Made Easy
[ start | index | login ]
start > Plugin Terminal

Plugin Terminal

Created by leo. Last edited by leo, 11 years and 17 days ago. Viewed 33,126 times. #2
[diff] [history] [edit] [rdf]
labels
attachments
The terminal plugin is a visual software component that acts as the front end to the user. It displays the data that is transmitted by the remote host and translates keystrokes to be sent to the remote host. It implements an ANSI, vt320/vt220/vt100 and SCOANSI compliant terminal.

Most of the features of the terminal emulation can be configured using the properties explained below. Additionally it provides a plugin menu that can be operated if a menu bar is available.

General Properties:

PropertyDocumentation
Terminal.foregroundSet the foreground color of the terminal. You can use 24 bit hexadecimal values: #ffffff is white and #000000 is black. This is just like the encoding you use in HTML.
Terminal.backgroundSet the background color of the terminal. You can use 24 bit hexadecimal values: #ffffff is white and #000000 is black. This is just like the encoding you use in HTML.
Terminal.cursor.foregroundSet the cursor foreground color. If unset this is the inverted current foreground.
Terminal.cursor.backgroundSet the cursor background color. If unset this is the inverted current background.
Terminal.localechoWhile both SSH and Telnet client part detect localechostate automatically, it can be overridden using this option. This is only recommended if you really need it.
Set to true for always localecho and false for never.
Terminal.print.colorSet to true to print the terminal in full color. The default setting false will force the Terminal to print black & white only.
Terminal.colorSetUse this property to define a complete color set for the terminal. A color set contains eight colors as defined by the ANSI standard.
The colorset should be in a file that is referenced by this property as either a file name relative to the jar file or a complete URL. (see colorSet.conf)
Terminal.borderDeclare the size of the border that will sourround the terminal.
Terminal.borderRaisedThis property has no effect if Terminal.border is not set or zero. It may be set to "true" or "false".
Terminal.scrollBarAdds a scroll bar to the terminal using the direction set in the property. Possible directions are "East" and "West". Using a "none" removes the scrollbar completely.
Terminal.beepIf this property points to a fully qualified URL of a sound file this will be played in case of a terminal bell signal. This works for applets only.
Note: Some browsers (Netscape 4, IE 5.5 or earlier) sometimes can only play .au files here. In IE the sound needs to be on the same server as the applet or you get a security exception.

Terminal Emulation Properties:

PropertyDocumentation
Terminal.idUsed to identify the type of the terminal. This is the string that is sent to the remote host. Default is "vt320" but you may use any string, like "vt100", "vt220" or "xterm" if it suits you.
If you change it to scoansi, it will change the linedrawing characters to match the scoansi ones.
Terminal.answerbackThe string the terminal sents back when it gets an 'ENQ' code. You can set it to anything you want or what your local environment requires. (The default is just a pointer to this config option.)
Terminal.bufferThis sets the size of the scroll back buffer the terminal uses. The buffer is allocated dynamically until it reaches this size. You cannot set the scrollback buffer to a value smaller than the amount of lines on the screen.
Terminal.sizeSet the size of the terminal in terms of rows and lines. The value has to be given in the following format: [width,height] Whitespaces are allowed within the brackets and just before and after the comma. The standard is "[80,24]"
Terminal.resizeThis property defines the method that is applied when the terminal window is resized. It may be either "font"
- to resize the font to match the window size or "screen"
- to change the amount of lines and columns displayed or "none"
- to do nothing.
Terminal.fontTells the terminal which font to use for the display of characters. This is usually "Monospaced" as any other font name might not be available on the client host.
Terminal.fontStyleThe font style to be used when looking up the font. The font style may be "plain", "bold" or "italic ". The default is "plain".
Terminal.fontSizeThe size of the font to be used. If you use automatic font resize this will be used as the initial font size.
Terminal.keyCodesThis should be set to the URL of a property file that contains the key codes you would like to use. The file is first tried using the resource loading mechanism, which looks in the CLASSPATH and then as a URL. Have a look at the file format for the key codes definition .
Terminal.VMSSet this property to "true" if you are connecting to a VMS system.
Terminal.IBMSet this to "true" if you would like to use PC ANSI graphics characters as used by some BBS's.
Terminal.encodingUse this property if you have real UNICODE fonts installed on your system or at least fonts that include the characters you would like to display. The default setting it ISO8859_1 but it may be used to make the terminal aware of special characters like in the japanese (i.e. SJIS) or chinese region.

Definition of Key Codes:

Available KeyCodes are (If you create a keycode definition file, >>send it to us so other don't have to do the work again.):

TypeComment
>>AT386A key code definition file for an AT-386 Terminal. It should work with ANSI and most version of UNIX. More info is in the file.

The definition of key codes should only be done if your application uses a very different keyboard layout than the standard vt320. The definition of almost all special keys is possible and follows rules described below:

# here is the rule
[SCA] KEY=STRING

The characters enclosed in [ and ] are optional and only one of the characters 'S' (Shift), 'C' (Control) or 'A' (Alt) may appear before the KEY, which is a textual representation (F1, PGUP etc) of the key you would like to redefine.

The new STRING you define to be sent when pressing the key should come after the equal sign (=). Hash marks (#) in the file declare a line as comment and will be ignored. Some examples explain the syntax:

Send the string "test" when pressing the F1 key:

F1 = test
On pressing Control + PGUP send the string "pgup pressed":
CPGUP = pgup pressed
Redefine the key Alt + F12 to send an escape character:
AF12 = \\e

As you can see the string you can define may contain special characters which may be escaped using the backslash (\). Allowed special characters follow in the table below:

(Important: for some of the escape codes you need two backslashes as these are our own definitions and not known by the Java Property mechanism)

CharacterExplanation
\\bBackspace, this character is usually sent by the <- key (not the cursor left key!).
\\eEscape, this character is usually sent by the Esc key.
\n(only one backslash) Newline, this character will move the cursor to a new line. On UNIX systems it is equivalent to carriage return + newline. Usually the Enter key send this character.
\r(only one backslash) Carriage Return, this key moves the cursor to the beginning of the line. In conjunction with Newline it moves the cursor to the beginning of a new line.
\t(only one backslash) Tabulator, the tab character is sent by the {key:->} key and moves the cursor to the next tab stop defined by the terminal.
\\vVertical Tabulator, sends a vertical tabulator character.
\\aBell, sends a terminal bell character which should make the terminal sound its bell, but the implementation is a silent one ;-)
\numberInserts the character that is defined by this number in the ISO Latin1 character set. The number should be a decimal value.

The following table explains which key may be redefined. As explained above each of the keys may be prefixed by a character defining the redefinition that occures if it is pressed in conjunction with the shift, control or alt keys.

KeyComments
F1 - F20The function key, F1, F2 … up to F20.
PGUPThe Page Up key.
PGDOWNThe Page Down key.
ENDThe End key.
HOMEThe Home (Pos 1) key.
INSERTThe Insert key.
REMOVEThe Remove key.
UPThe Cursor Up key.
DOWNThe Cursor Down key.
LEFTThe Cursor Left key.
RIGHTThe Cursor right key.
NUMPAD0 - NUMPAD9The numbered Numpad keys.
ESCAPEThe ESCAPE key.
BACKSPACEThe backspace key.
TABThe tabulator key.
no comments | post comment
Telnet+SSH+Terminal
legacy communication tools for JAVA(tm)

javassh.org | Copyright 1996-2009 Matthias L. Jugel and Marcus Meißner

JAVA is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries.
The JTA - Telnet/SSH Authors (Matthias L. Jugel and Marcus Meißner) are independent of Sun Microsystems, Inc.