Session file

From The x3270 Wiki

A session file contains resources (settings) for a particular host session. It is a convenient way to set multiple options at once without creating a huge command line. Except in b3270, a session file can include a hostname resource to specify a host to connect to at start-up.

By convention, a session file has the same suffix as the emulator that uses it. For example, an x3270 session file has the suffix .x3270.

wc3270 includes a utility, the Session Wizard, that automatically maintains a set of session files.

Note: wx3270 uses a different kind of file for this purpose, a Wx3270 profile. The tools for maintaining profiles are built into wx3270.


The syntax of a session file derives from X11 Resource Files.

Each line consists of a resource name, a colon, and a value. White space after the colon is not considered part of the value. A resource name must be fully-qualified. The easiest way to do this is to prefix it with an asterisk (*). The name of the emulator and a dot (.) can also be used to qualify the name. This allows the same resource file to be used with different kinds of emulators, using different values for each kind.

A comment line begins with an exclamation point (!).

Multiple lines can be joined by ending a line with a backslash (\). The trailing backslash and newline character (or carriage return / line feed sequence) are then removed from the entry before processing.

Except at the end of a line, a backslash introduces an escape sequence.

Escape sequences

A newline character (U+000A)
A tab character (U+0009)
A carriage return character (U+000D)
A backspace character (U+0008)
A form feed character (U+000C)
A backslash character (U+005C)

If a backslash is followed by any other character, the backslash will simply be removed.


Define the blankFill resource to true.

*blankFill: true

Define blankFill for wc3270 to true.

wc3270.blankFill: true

Same as above but with a comment.

! Set blank fill to true.
wc3270.blankFill: true

Define an x3270 keymap, split across multiple lines. Note that the \n on the second line becomes a newline character, which is required by x3270 keymap syntax.

! Definition of the 'mine' keymap
x3270.keymap.mine: #override \
 <Key>Prior: PF(7)\n\
 <Key>Next: PF(8)

Define a wc3270 traceDir resource. Note that backslashes in Windows pathnames must be doubled.

wc3270.traceDir: C:\\Users\\Bob\\Trace Files