The Xterm Title HOW-TO is simplified. From XTerm Control Sequences
OSC Ps ; Pt ST
OSC Ps ; Pt BEL
Ps = 0 -> Change Icon Name and Window Title to Pt.
Ps = 1 -> Change Icon Name to Pt.
Ps = 2 -> Change Window Title to Pt.
OSC could be escape], or 0x9d).
Some applications (such as
screen) know about the three possibilities (0=both, 1=icon, 2=title), though it took a while to get to that point (see fix).
According to the XStoreName manual page
XStoreName() function assigns the name passed to window_name to the specified window. A window manager can display the window name in some prominent place, such as the title bar, to allow users to identify windows easily. Some window managers may display a window's name in the window's icon, although they are encouraged to use the window's icon name if one is provided by the application. If the string is not in the Host Portable Character Encoding, the result is implementation dependent.
The call sets a window manager property. Many window manager properties are optional, allowing for different implementations. The ICCM documents WM_ICON_NAME as
WM_ICON_NAME property is an uninterpreted string that the client wants to be displayed in association with the window when it is iconified (for example, in an icon label). In other respects, including the type, it is similar to
WM_NAME. For obvious geometric reasons, fewer characters will normally be visible in
Clients should not attempt to display this string in their icon pixmaps or windows; rather, they should rely on the window manager to do so.
The encoding mentioned for
XStoreName is a clue. It is not UTF-8. After several years (around the early 2000s), of introducing Unicode strings into applications designed for ISO-8859-1 (Latin-1), e.g., this gem, some window manager developers came up with Extended Window Manager Hints to rectify the situation and provide for extensions. It uses different window properties, e.g., _NET_WM_ICON_NAME
The Client SHOULD set this to the title of the icon for this window in UTF-8 encoding. If set, the Window Manager should use this in preference to
Again, this is optional. Desktop developers may have different ideas about how to show icons, and graphic images seem to have gotten more attention, usually at the expense of accessibility. However, it is still part of the standard, used by a few window managers such as fvwm, twm, ctwm. If someone were to make an accessible version of KDE or GNOME, they might use this property.