Current compatibility score: ~99-100% (all gaps resolved: OSC resets, DECRQM, DECSCA, DECDWL/DECDHL, DECBI/DECFI, DECLRMM, BiDi/RTL).
This document lists all previously identified gaps — now resolved.
The SET counterparts (OSC 4/10/11/12) are implemented, but their reset variants are missing.
- OSC 104;index ST — Reset palette color at index to default
- OSC 104 ST (no index) — Reset entire palette to defaults
- OSC 110 ST — Reset foreground color to default
- OSC 111 ST — Reset background color to default
- OSC 112 ST — Reset cursor color to default
Where: handleOSC() in SystemTrayTerminal.swift
Effort: Low — just clear paletteOverrides[idx], dynamicFG, dynamicBG, dynamicCursor
Full reset (ESC c / RIS) is implemented, but soft reset (DECSTR) is missing. Many TUI apps use DECSTR instead of RIS.
What DECSTR resets:
- Text attributes (SGR) to defaults
- Insert mode off
- Origin mode off
- Auto-wrap on
- Cursor visible
- Scroll region to full screen
- Character sets to default
- Saved cursor state
What DECSTR does NOT reset:
- Screen contents
- Tab stops
- Window size
- Palette/colors
Where: doCSIBang() handler for CSI ! p
Effort: Low — subset of fullReset() without clearing grid/scrollback
Insert N blank characters at cursor, shifting existing content right. Different from IRM (insert mode) which affects put() — ICH is an explicit CSI command.
Where: doCSI() — add case 0x40
Effort: Low
Delete N characters at cursor, shifting remaining content left and filling from the right with blanks.
Where: doCSI() — check if case 0x50 exists, implement if missing
Effort: Low
Private mode DECRQM (CSI ? Ps $ p) is implemented, but standard mode DECRQM (CSI Ps $ p) is missing. Some apps query standard modes like IRM (4), LNM (20).
Response format: CSI Ps; Pm $ y where Pm = 1 (set), 2 (reset), 0 (unknown)
Where: doCSIDollar() handler
Effort: Low
Window manipulation sequences used by some TUI apps:
CSI 8;rows;cols t— Resize window (already haveonResizecallback)CSI 14 t— Report window size in pixels → respondCSI 4;height;width tCSI 18 t— Report text area size in chars → respondCSI 8;rows;cols tCSI 22;0 t/CSI 22;2 t— Push title to stackCSI 23;0 t/CSI 23;2 t— Pop title from stack
Where: doCSI() — add case 0x74
Effort: Medium — need title stack and pixel dimension reporting
Repeat the last printed character N times. Some apps use this for efficient screen filling.
Where: doCSI() — add case 0x62, use lastChar
Effort: Low — already tracking lastChar
Scroll the scroll region up/down by N lines without moving the cursor. Different from scrolling via cursor movement.
Where: doCSI() — check if cases 0x53 / 0x54 exist
Effort: Low
Move cursor to absolute row. Should respect origin mode.
Where: doCSI() — check if case 0x64 exists and handles origin mode correctly
Effort: Low
Character protection prevents erasure of marked cells by ED/EL/ECH.
- SGR 1 (DECSCA):
CSI 1 " q— set protection attribute - SGR 0 (DECSCA):
CSI 0 " q— reset protection attribute - SPA/EPA:
ESC V/ESC W— start/end guarded area
Effort: Medium — requires checking protection flag in all erase operations Usage: Rare in modern apps
ESC # 6— Double-width line (DECDWL)ESC # 3— Double-height line, top half (DECDHL)ESC # 4— Double-height line, bottom half (DECDHL)
Effort: High — requires per-line width attribute and renderer changes Usage: Very rare, mostly legacy VT100 demos
ESC 6— Back Index (DECBI): move cursor left, scroll right if at left marginESC 9— Forward Index (DECFI): move cursor right, scroll left if at right margin
Effort: Medium Usage: Rare
Unicode bidirectional text rendering for Arabic, Hebrew etc.
Effort: Very High — requires UAX #9 bidi algorithm Usage: Important for i18n but extremely complex
CSI ? 69 h— Enable left/right marginsCSI Pl ; Pr s— Set left/right margins (DECSLRM, conflicts with SCOSC)
Allows horizontal scroll regions. Very few apps use this.
Effort: High — affects all cursor movement and scroll operations Usage: Rare
- OSC 104/110/111/112 (color reset)
- DECSTR (soft reset, CSI ! p)
- ICH (insert characters, CSI @)
- DCH (delete characters, CSI P)
- DECRQM standard modes (CSI $ p)
- CSI t (window manipulation + title push/pop)
- REP (repeat character, CSI b)
- SU/SD (scroll up/down, CSI S/T)
- VPA origin mode check
- DECSCA / SPA / EPA (protected attributes)
- DECDWL / DECDHL (double width/height)
- DECBI / DECFI (back/forward index)
- BiDi / RTL text (Core Text based bidi reordering)
- DECLRMM (left/right margins)