NVT (ANSI) Mode
The PrintText Action
Macros and Scripts
The full syntax for host is:
Prepending a P: onto hostname causes the connection to go through the telnet-passthru service rather than directly to the host. See PASSTHRU below.
Prepending an S: onto hostname removes the "extended data stream" option reported to the host. See -tn below for further information.
Prepending an N: onto hostname turns off TN3270E support for the session.
Prepending an L: onto hostname causes x3270 to first create an SSL tunnel to the host, and then create a TN3270 session inside the tunnel. (This function is supported only if x3270 was built with SSL/TLS support). Note that TLS-encrypted sessions using the TELNET START-TLS option are negotiated with the host automatically; for these sessions the L: prefix should not be used.
A specific Logical Unit (LU) name to use may be specified by prepending it to the hostname with an `@'. Multiple LU names to try can be separated by commas. An empty LU can be placed in the list with an extra comma. (Note that the LU name is used for different purposes by different kinds of hosts. For example, CICS uses the LU name as the Terminal ID.)
The hostname may optionally be placed inside square-bracket characters `[' and `]'. This will prevent any colon `:' characters in the hostname from being interpreted as indicating option prefixes or port numbers. This allows numeric IPv6 addresses to be used as hostnames.
On systems that support the forkpty library call, the hostname may be replaced with -e and a command string. This will cause x3270 to connect to a local child process, such as a shell.
The port to connect to defaults to telnet. This can be overridden with the -port option, or by appending a port to the hostname with a colon `:'. (For compatability with previous versions of x3270 and with tn3270(1), the port may also be specified as a second, separate argument.)
The first part is the base model, which is either 3278 or 3279. 3278 specifies a monochrome (green on black) 3270 display; 3279 specifies a color 3270 display.
The second part is the model number, which specifies the number of rows and columns. Model 4 is the default.
Note: Technically, there is no such 3270 display as a 3279-4 or 3279-5, but most hosts seem to work with them anyway.
The default model for a color X display is 3279-4. For a monochrome X display, it is 3278-4.
Some hosts are confused by the -E suffix on the terminal name, and will ignore the extra screen area on models 3, 4 and 5. Prepending an s: on the hostname, or setting the "x3270.extended" resource to "false", removes the -E from the terminal name when connecting to such hosts.
The name can also be specified with the "x3270.termName" resource.
After reading resource definitions from the X server and any standandard X11 resource definition files ($HOME/.Xdefaults, etc.), x3270 will read definitions from the file $HOME/.x3270pro. This file contains local customizations and is also used to save changed options by the Save Changed Options in File menu option.
Note that -xrm options override any definitions in the .x3270pro file.
The font may be specified with the -efont option or the "x3270.emulatorFont" resource.
x3270 can also use any X11 font that implements the display character set required by the host EBCDIC character set.
An additional font, 3270d, is supplied. This font is identical to the default 3270 font, except that it has bitmaps defined for field attribute characters. This means that field attributes, which are normally displayed as blanks, are now visible on the screen. The characters displayed are hexadecimal codes, which can be translated using a document provided with the x3270 sources.
The font can be changed at any time through a menu option. It can also be implicitly changed by changing the size of the x3270 window with the mouse: if the window is made larger, x3270 will try to change to a larger font, and vice-versa.
The default character set is bracket, which is useful for common U.S. IBM hosts which use EBCDIC codes AD and BD for the `[' and `]' characters, respectively.
Note that any of the host code pages listed above can be specified by adding cp to the host code page, e.g., cp037 for host code page 037. Also note that the code pages available for a given version of x3270 are displayed by the -v command-line option.
Most 3270 fonts implement the 3270cg-1 display character set, which is a reordered version of the ISO 8859-1 character set. Some implement the 3270cg-1a display character set, which is a superset of 3270cg-1 that includes APL2 characters. 3270h and 3270gr implement special character sets for Hebrew and Greek, respectively.
You can also specify national-language translations for your keyboard; see KEYMAPS below.
See xterm(1) for further syntax details.
|left||in a separate window, to the left of the screen|
|right||in a separate window, to the right of the screen|
|bottom||in a separate window, below the screen|
|integral||in the same window as the screen, below it|
The default is right.
If the "x3270.keypadOn" resource is set to true, the keypad will be displayed at startup.
You may specify a different ibm_hosts database with the "x3270.hostsFile" resource.
The color scheme may also be changed while x3270 is running with a selection from the Options menu.
If the host later negotiates to stop functioning in 3270 mode, x3270 will return to ANSI emulation.
In NVT mode, x3270 supports both character-at-a-time mode and line mode operation. You may select the mode with a menu option. When in line mode, the special characters and operational characteristics are defined by resources:
|Translate CR to NL||x3270.icrnl||true|
|Translate NL to CR||x3270.inlcr||false|
|Erase previous character||x3270.erase||^?|
|Erase entire line||x3270.kill||^U|
|Erase previous word||x3270.werase||^W|
|Ignore special meaning of next character||x3270.lnext||^V|
|End of file||x3270.eof||^D|
Separate keymaps can be defined for use only when x3270 is in 3270 mode or NVT mode. See KEYMAPS for details.
The menu bar can be turned off by setting the "x3270.menuBar" resource to false.
Many sections of the File and Options menus are toggles, options that may be either on or off. The entries under the File menu are as follows:
The toggles under the Options menu are as follows:
The names of the toggles for use with the -set and -clear options are as follows:
|Trace Data Stream||dsTrace|
|Trace Keyboard/Mouse Events||eventTrace|
|Save Screen(s) in File||screenTrace|
|Paste with Left Margin||marginedPaste|
|Select by Rectangles||rectangleSelect|
In addition, the toggle altCursor can be used to select the cursor type. If set, an underline cursor will be used. If clear, the normal block cursor will be used.
These names also represent resources that can be set in your .Xdefaults
or .x3270pro file.
For example, if you always want to have the scrollbar on, you can add
the following to your .Xdefaults or .x3270pro:
These names are also used as the first parameter to the Toggle action.
However, twm does not put labels on application-supplied icon windows. You can have x3270 add its own label to the icon by setting the "x3270.labelIcon" resource to true. The default font for icon labels is 8x13; you may change it with the "x3270.iconLabelFont" resource.
The type of keyboard may be specified with the -keymap switch or using either the KEYMAP or KEYBD environment variables. The types of supported keyboards include sun_k3, sun_k4, sun_k5, hp-k1, hp-pc and ncd.
The keymap may also be specified as a comma-separated list of names. Later definitions override earlier ones. This is used to specify both a primary keyboard type and a set of modifiers. The modifiers defined include:
A temporary keymap can also be specified while x3270 is running with the Keymap action. When the action Keymap(n) is executed, temporary keymap n is added to or deleted from the current keymap. Multiple temporary keymaps can be active simultaneously. The action Keymap(None) restores the original keymap. Note: When Keymap() is specified as part of a list of multiple actions in a keymap, it must be the last action in the list.
The temporary keymap hebrew is provided to allow entry of Hebrew characters.
The X Toolkit translation mechanism is used to provide keyboard emulation. It maps events into actions. The best documentation can be found with X toolkit documents, but the following should suffice for simple customization.
An Xt event consists of (at least) four fields. The first is called a modifier. It may be any combination of Meta, Shift and Ctrl. If it is prefaced by !, it means those modifiers only. The second field is the specific event, in x3270 usually just <Key>. The third field is the detail field, which gives the actual key. The name of the key may be determined using the xev program or with the "Trace X Events" menu option. The last field is the action, which is the internal emulator function. A complete list of actions may be found later in the manual.
There are three levels of translation tables in x3270. The first is a defined by the resource x3270.keymap.base. It defines alphabetic, numeric, function keys, and such basic functions as Enter and Delete. It allows a minimal useful functionality. It is generally compiled in x3270, but can be overridden.
The second level is a keyboard specific table, which is selected by the x3270.keymap resource, and defined by the x3270.keymap.name resource (where name is the value of the x3270.keymap resource). This keymap defines actions for such things as keypad keys, and keys unique to certain keyboards. Several predefined keymaps are included with x3270.
The third level is a user customizable table which may be used to augment or override key definitions. This keymap is defined by the x3270.keymap.name.user resource.
In addition, keymaps may be defined for use in 3270 mode or NVT mode only. These keymaps use the suffixes .3270 and .nvt in their names, respectively. If a keymap x3270.keymap.name.mode is defined, it will augment the keymap x3270.keymap.name when x3270 is in the given mode. If a keymap x3270.keymap.name.user.mode is defined, it will augment the keymap x3270.keymap.name.user when x3270 is in the given mode.
The default translation table x3270.keymap.base is:
The default 3270-mode table x3270.keymap.base.3270 adds the following definitions:
Meta is the diamond shaped key on a sun_k4, "Alt" on an NCD, "Extend Char" on an HP. The following xmodmap command must be used on the NCD to allow use the the "Alt" key:
xmodmap -e "keysym Alt_L = Meta_L"
The left mouse button may be used to make a selection. Clicking once unselects the current selection. Clicking twice selects the word under the mouse cursor. Clicking three times selects the line under the mouse cursor. Clicking and dragging selects a rectangular area of the display.
The middle mouse button may be used to paste a selection.
The right mouse button may also be used for selections, selecting the rectangular area between the current position and where the left button was last pressed.
On color X displays, the "x3270.selectBackground" resource is used to distinguish the selected text from the rest of the screen. On monochrome X displays, selected text is in reverse video. (It can be distinguished from a block cursor because the block cursor covers slightly less than an entire character position on the screen.)
The left mouse button, when pressed with the "Shift" key held down, moves the 3270 cursor to the where the mouse cursor is pointing.
This is the complete list of keymap-callable actions. Other actions are defined for use by scripts and are documented in x3270-script(1); still others are defined for internal use by x3270 and are not documented here. Note that when an action with no parameters is used in a keymap, the parentheses and empty argument list are still required.
Actions marked with an asterisk (*) may block, sending data to the host and possibly waiting for a response.
|AltCursor||switch between block and underscore cursor|
|BackSpace||move cursor left (or send ASCII BS)|
|BackTab||tab to start of previous input field|
|CircumNot||input "^" in NVT mode, or "¬" in 3270 mode|
|Compose||next two keys form a special symbol|
|*Connect(host)||connect to host|
|*CursorSelect||Cursor Select AID|
|Cut||erase selected text|
|Default||enter key literally|
|Delete||delete character under cursor (or send ASCII DEL)|
|DeleteField||delete the entire field|
|DeleteWord||delete the current or previous word|
|*Disconnect||disconnect from host|
|Down||move cursor down|
|*Enter||Enter AID (or send ASCII CR)|
|Erase||erase previous character (or send ASCII BS)|
|EraseEOF||erase to end of current field|
|EraseInput||erase all input fields|
|Execute(cmd)||execute a command in a shell|
|FieldEnd||move cursor to end of field|
|HandleMenu(name)||pop up a menu|
|HexString(hex_digits)||insert control-character string|
|Home||move cursor to first input field|
|Insert||set insert mode|
|*Interrupt||send TELNET IP to host|
|Key(keysym)||insert key keysym|
|Key(0xxx)||insert key with character code xx|
|Keymap(keymap)||toggle alternate keymap (or remove with None)|
|KybdSelect(direction [,atom...])||Extend selection by one row or column|
|Left||move cursor left|
|Left2||move cursor left 2 positions|
|*Macro(macro)||run a macro|
|MonoCase||toggle uppercase-only mode|
|MoveCursor||move cursor to mouse position|
|MoveCursor(row, col)||move cursor to (row,col)|
|*MoveCursorSelect||move cursor to mouse position, light pen selection|
|Newline||move cursor to first field on next line (or send ASCII LF)|
|NextWord||move cursor to next word|
|*PA(n)||Program Attention AID (n from 1 to 3)|
|*PF(n)||Program Function AID (n from 1 to 24)|
|PreviousWord||move cursor to previous word|
|Printer(Start[,lu]|Stop)||start or stop printer session|
|PrintText(command)||print screen text on printer|
|PrintWindow(command)||print screen image (bitmap) on printer|
|*Reconnect||reconnect to previous host|
|Reset||reset locked keyboard|
|Right||move cursor right|
|Right2||move cursor right 2 positions|
|*Script(command[,arg...])||run a script|
|SelectAll(atom)||select entire screen|
|SetFont(font)||change emulator font|
|*String(string)||insert string (simple macro facility)|
|*SysReq||System Request AID|
|Tab||move cursor to next input field|
|Toggle(option[,set|clear])||toggle an option|
|ToggleInsert||toggle insert mode|
|ToggleReverse||toggle reverse-input mode|
|Up||move cursor up|
|(the following are similar to xterm)|
|move-select||a combination of MoveCursor and select-start|
|select-end(atom[,atom...]])||complete selection and assign to atom(s)|
|select-extend||move the end of a selection|
|select-start||mark the beginning of a selection|
|set-select(atom[,atom...]])||assign existing selection to atom(s)|
|start-extend||begin marking the end of a selection|
|\exxxx||EBCDIC character in hex|
|\uxxxx||Unicode character in hex|
|\xxxxx||Unicode character in hex|
Note that the numeric values for the \e, \u and \x sequences can be abbreviated to 2 digits. Note also that EBCDIC codes greater than 255 and some Unicode character codes represent DBCS characters, which will work only if x3270 is built with DBCS support and the host allows DBCS input in the current field.
An example keymap entry would be:
Meta<Key>p: String("probs clearrdr\n")
Note: The strings are in ASCII and converted to EBCDIC, so beware of inserting control codes. Also, a backslash before a p may need to be doubled so it will not be removed when a resource file is read.
There is also an alternate form of the String action, HexString, which is used to enter non-printing data. The argument to HexString is a string of hexadecimal digits, two per character. A leading 0x or 0X is optional. In 3270 mode, the hexadecimal data represent EBCDIC characters, which are entered into the current field. In NVT mode, the hexadecimal data represent ASCII characters, which are sent directly to the host.
log off: String("logout\n")\n\
vtam: String("dial vtam\n")\n\
alt printer: PrintText("lpr -Plw2")
You can also define a different set of macros for each host. If there is a resource named `x3270.macros.somehost', it defines the macros menu for when x3270 is connected to somehost.
The mappings between these pairs of ordinary keys and the symbols they represent is controlled by the "x3270.composeMap" resource; it gives the name of the map to use. The maps themselves are named "x3270.composeMap.name". The default is "latin1", which gives mappings for most of the symbols in the ISO 8859-1 Latin-1 character set that are not in the 7-bit ASCII character set.
Note: The default keymap defines the "Multi_key" keysym as the "Compose" key. If your keyboard lacks such a key, you may set up your own "Compose" key with a keymap that maps some other keysym onto the Compose action.
APL characters are supported only in the special 3270 font.
Keyboard entry of APL characters is supported through the apl keymap modifier. This modifier defines the "Alt" key as an APL shift key, with a typical APL keyboard layout, e.g., "Alt" pressed with the A key results in the APL "alpha" symbol. Overstruck characters such as "quad-quote" are not defined as single keystrokes; instead they are entered as composites (see COMPOSITE CHARACTERS above). A special composite map, apl, is provided for this purpose.
Note: Some keyboards do not define the "Alt" key as a modifier, so keymaps that use the "Alt" key will not function. On a Sun for example, this can be remedied with the command:
xmodmap -e "add mod2 = Alt_L"
For convenience, an -apl option is defined, which is an abbreviation for the following resource definitions:
There are a number of APL characters that are similar in appearance to non-APL characters. In particular, the APL "stile", "slope," "tilde" and "quotedot" characters are similar to the EBCDIC "bar", "backslash," "tilde" and "exclaim" characters. The APL characters are entered with the "Alt" key, and have slightly different appearances.
The complete list of special APL keysyms is as follows. Entries marked with an asterisk (*) represent simple aliases for standard EBCDIC characters. Entries marked with an (S) represent Sharp APL charatcers.
|APL Symbol||Hex||x3270 apl_ Keysym||x3270 Key||x3270 Composed Keys|
|A underbar||41||Aunderbar||Alt-A||A + underbar|
|B underbar||42||Bunderbar||Alt-B||B + underbar|
|C underbar||43||Cunderbar||Alt-C||C + underbar|
|circle bar||ED||circlebar||circle + bar|
|circle slope||CF||circleslope||circle + slope|
|circle star||FD||circlestar||circle + star|
|circle stile||CD||circlestile||circle + stile|
|comma bar (S)||E5||commabar||comma + bar|
|D underbar||44||Dunderbar||Alt-D||D + underbar|
|del stile||DC||delstile||del + stile|
|del tilde||FB||deltilde||del + tilde|
|delta stile||DD||deltastile||delta + stile|
|delta underbar||FC||deltaunderbar||delta + underbar|
|diamond||70||diamond||up caret + down caret|
|dieresis circle (S)||E5||dieresiscircle||dieresis + circle|
|dieresis dot||EC||dieresisdot||dieresis + dot|
|dieresis jot (S)||E4||dieresisjot||dieresis + jot|
|down caret tilde||CB||downcarettilde||down caret + tilde|
|down tack jot||FE||downtackjot||down tack + jot|
|down tack up tack||DA||downtackuptack||down tack + up tack|
|E underbar||45||Eunderbar||Alt-E||E + underbar|
|epsilon underbar||75||epsilonunderbar||epsilon + underbar|
|equal underbar||E1||equalunderbar||equal + underbar|
|euro (S)||E7||euro||C + =|
|F underbar||46||Funderbar||Alt-F||F + underbar|
|G underbar||47||Gunderbar||Alt-G||G + underbar|
|H underbar||48||Hunderbar||Alt-H||H + underbar|
|I underbar||49||Iunderbar||Alt-I||I + underbar|
|iota underbar||74||iotaunderbar||iota + underbar|
|J underbar||51||Junderbar||Alt-J||J + underbar|
|K underbar||52||Kunderbar||Alt-K||K + underbar|
|L underbar||53||Lunderbar||Alt-L||L + underbar|
|M underbar||54||Munderbar||Alt-M||M + underbar|
|N underbar||55||Nunderbar||Alt-N||N + underbar|
|not equal||BE||notequal||Alt-8||equal + slash|
|not greater||8C||notgreater||Alt-4||less + equal|
|not less||AE||notless||Alt-6||greater + equal|
|O underbar||56||Ounderbar||Alt-O||O + underbar|
|P underbar||57||Punderbar||Alt-P||P + underbar|
|Q underbar||58||Qunderbar||Alt-Q||Q + underbar|
|quad divide||EE||quaddivide||quad + divide|
|quad jot||73||quadjot||quad + jot|
|quad quote||DE||quadquote||quad + quote|
|quad slope||CE||quadslope||quad + slope|
|quote dot||DB||quotedot||quote + dot|
|R underbar||59||Runderbar||Alt-R||R + underbar|
|S underbar||62||Sunderbar||Alt-S||S + underbar|
|slash bar||EA||slashbar||slash + bar|
|slope bar||EB||slopebar||slope + bar|
|squad||CC||squad||quad + quad|
|T underbar||63||Tunderbar||Alt-T||T + underbar|
|U underbar||64||Uunderbar||Alt-U||U + underbar|
|up caret tilde||CA||upcarettilde||up caret + tilde|
|up shoe jot||DF||upshoejot||up shoe + jot|
|up tack jot||EF||uptackjot||up tack + jot|
|V underbar||65||Vunderbar||Alt-V||V + underbar|
|W underbar||66||Wunderbar||Alt-W||W + underbar|
|X underbar||67||Xunderbar||Alt-X||X + underbar|
|Y underbar||68||Yunderbar||Alt-Y||Y + underbar|
|Z underbar||69||Zunderbar||Alt-Z||Z + underbar|
The input method is selected by the XMODIFIERS environment variable or the -im command-line option.
The preedit type is specified by the -pt command-line option, with a default of OverTheSpot+1.
The PrintText action (usually assigned to the key <Meta>p) sends the current screen image to the printer as ASCII characters. The default command used to print the data is controlled by the "x3270.printTextCommand" resource; the default is lpr. You may also use a keymap definition to pass a print command the PrintText action itself. The command receives the screen text as its standard input. For example, the following keymap will save the screen text in a file:
Meta<Key>f: PrintText("cat >screen.image")
Note: HardPrint is an alias for PrintText.
The PrintWindow action (usually assigned to the key <Meta>b) sends the current screen image to the printer as a bitmap. The default command used to print the data is controlled by the "x3270.printWindowCommand" resource; the default is
xwd -id %d | xpr | lpr.
You may also use a keymap definition to pass a print command to the PrintWindow action itself. If the command contains the text "%d", the window ID of x3270 will be substituted before it is run. For example, the following keymap will pop up a duplicate of the current screen image:
Meta<Key>g: PrintWindow("xwd -id %d | xwud &")
If the command for PrintWindow or PrintText begins with an "@" character, the initial pop-up menu to confirm the print command is not displayed and the command cannot be edited.
type:host[:port]The supported values for type are:
The special types socks4a and socks5d can also be used to force the proxy server to do the hostname resolution for the SOCKS protocol.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY PAUL MATTES, DON RUSSELL, DICK ALTENBERN, JEFF SPARKES AND GTRC "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PAUL MATTES, DON RUSSELL, DICK ALTENBERN, JEFF SPARKES OR GTRC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.