SS2/SS3
SS2 (Single-Shift Two) and SS3 (Single-Shift Three) are C1 control functions that temporarily invoke the G2 or G3 character set for the next graphic character only.
Syntax
ESC N SS2 — Single-shift G2 (7-bit)
0x8E SS2 — Single-shift G2 (8-bit C1)
ESC O SS3 — Single-shift G3 (7-bit)
0x8F SS3 — Single-shift G3 (8-bit C1)
SS2 = ( 0x1b, "N" ) | 0x8e ; SS3 = ( 0x1b, "O" ) | 0x8f ;
Description
Per ECMA-48 §8.3.141 and §8.3.142, SS2 and SS3 are used for code extension purposes, causing the meanings of the bit combinations following them to be changed. Their detailed use is defined in ECMA-35.
Unlike the locking shifts (SO/SI, LS2, LS3), which change the active character set until explicitly changed back, single shifts affect only the very next graphic character:
- SS2 temporarily invokes G2 into GL for the next character, then GL reverts to its previous state.
- SS3 temporarily invokes G3 into GL for the next character, then GL reverts to its previous state.
SS3 and function keys
In practice, SS3 is most commonly encountered as part of function key escape sequences in application mode. For example, when the cursor keys are in application mode (DECCKM set), the arrow keys send SS3 A, SS3 B, SS3 C, SS3 D — which in 7-bit form are ESC O A, ESC O B, etc.
The keypad in application mode (DECKPAM) also sends SS3-prefixed sequences: ESC O p through ESC O y for digits 0-9.
Because ESC O is the 7-bit encoding of SS3, there can be ambiguity when a terminal receives ESC O — it could be the start of a function key sequence or an actual SS3 character set shift. In practice, modern terminals always interpret it in the function key context.
Specifications
| Specification | Section |
|---|---|
| ECMA-48 | §8.3.141, §8.3.142 |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✗ | No | No SS2/SS3 single shift support found; not in escape_support.md |
| Bobcat | ✓ | 0.9.0 | Single shift sequences, handled in TerminalCtrl library |
| contour | ✓ | v0.1.0 | ESC N (SS2) and ESC O (SS3) implemented; single shift G2/G3 charsets |
| foot | ✓ | Yes | Implemented in vt.c:517-525 as ESC N/O |
| Ghostty | ✓ | v1.0.0 | ESC N and ESC O handled in stream.zig:2215-2239, single shift G2/G3 |
| iTerm2 | ✗ | No | Explicitly marked as VT100_NOTSUPPORT |
| Kitty | ✗ | No | |
| Konsole | ✗ | No | No handlers for ESC N/O sequences |
| mintty | ✓ | Yes | SS2 at src/termout.c:2049-2050, SS3 at src/termout.c:2051-2052 |
| mlterm | ✓ | rel-0_2_1 | Delegated to mef library for ISO-2022 encodings |
| PuTTY | ✗ | No | ESC N and ESC O not implemented in escape sequence handler |
| Rio | ✗ | No | No ESC N or ESC O handling found |
| rxvt-unicode | ✗ | No | Explicitly commented out in code |
| st | ✗ | No | Marked TODO in st.c:2272-2273 |
| terminology | ✗ | No | Commented out, not implemented |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | |
| WezTerm | ✓ | Yes | Defined in esc.rs:42-43 as EscCode::SingleShiftG2/G3 (ESC N/O) |
| Windows Terminal | ✓ | Yes | ESC N dispatches SingleShift(2), ESC O dispatches SingleShift(3) in OutputStateMachineEngine.cpp:235-239 |
| xterm | ✓ | Yes | Implemented in charproc.c:5474-5486. Requires vtXX_level > 1 (VT220+) |
| xterm.js | ✗ | No | SS2/SS3 used in keyboard output encoding but not handled as input |
| Multiplexers | |||
| cy | ✗ | No | ESC N/O not in EscDispatch |
| GNU Screen | ✓ | v.4.2.0 | SS2 (ESC N) and SS3 (ESC O) implemented in DoESC() at src/ansi.c:776-788 |
| tmux | ✗ | No | ESC N and ESC O not in escape table |
| tuios | ✓ | v0.0.15 | |
| Zellij | ✗ | No | |
See also
- SO/SI — Shift Out/In — Locking shifts for G0/G1
- Locking Shifts — LS2, LS3, and right-hand locking shifts
- DECKPAM/DECKPNM — Application/Numeric Keypad — Keypad mode that uses SS3 sequences