Names and titles

Some notes on how sessions and windows are named and identified. This needs to be updated. Merge with Sessions and Windows section.

Session name

The session name is an optional user-specified name for a terminal session. It is recommended that this be unique, but that is not enforced. The session name can be specified with the -session-name (or --sn) option in the domterm new command. You can also dynamically change the session name with an escape sequence:

echo -en "\e]30;session-name\007"

It is recommended (but not required) that a session name have the format of an “identifier”: The first character should be a letter, and the rest should be letters, digits, hyphen, or underscore.

Session number

The session number is a positive integer associated with a terminal session. It is unique within a domterm server.

Session specifier

The domterm attach command requires a session specifier, which can be any one of:

DomTerm element attributes

Each DomTerm instance in a browser has a corresponding <div> element which has domterm in its class attribute. The <div class="domterm"> element also has the following identifying attributes, which can be used for session-specific styling:

Window name

The window name is a short name displayed for each terminal in the window title or tab. It is constructed from up to 3 parts:

  1. The session name, or DomTerm if the session name is not specified.
  2. If the session name is unset or not unique, we add a colon and the session number.
  3. If there is more than one window attached to the same terminal, then we add a period followed by window number.

Window title and icon title

The window and icon titles are strings sent by the application. The escape sequences are those of xterm. They are commonly sent by shells (for example using bash’s PROMPT_COMMAND) and may include the current directory and maybe other information. Most terminal emulators include the window title string in the window title bar.

Window and tab title bars

When tabs are used, DomTerm displays the window name in each tab. For active tabs, DomTerm displays both the window name (normally the session name) and the window title (typically the current directory). This information may be shown in the main window title bar as well as the currently active tab.