Repository navigation
Closed
Labels
bugSomething isn't working
Description
Summary
TMUX_PROFILE in src/libvt/config.py and src/libvt/terminal.py (#2) models tmux's right-margin phantom column (s->cx == sx) on CUB and BS only, diverging from live tmux 3.8a across 12 other right-margin operations (EL 0 wiping column 79 on top reverse-video headers, ED 0, ECH, ICH, DCH, CBT, LF/IND/RI/VPA, DECRC, and CSI 6 n), mid-line IL/DL horizontal cursor retention, capture-pane -e bare SO/SI G1 DEC Special Graphics, and post-3.8 wide-cell ICH (b03b71f) and REP (8b95395) changes.
Reproduction
- Feed a full-width reverse-video header followed by
SGR 0andEL 0(CSI K), plusCSI 6 nand mid-lineIL(CSI L), underTMUX_PROFILE:
$ uv run python -c 'from libvt import TMUX_PROFILE, Terminal; vt = Terminal(rows=4, cols=20, profile=TMUX_PROFILE); vt.feed(b"\x1b[7mABCDEFGHIJKLMNOPQRST\x1b[m\x1b[K\x1b[6n"); print("row0:", repr(vt.screen[0].text), "cpr:", vt.drain_replies()); vt2 = Terminal(rows=4, cols=20, profile=TMUX_PROFILE); vt2.feed(b"abcdef\x1b[1;4H\x1b[Lx"); print("il:", vt2.lines)'Expected
Against tmux 3.8a (tmux -f /dev/null):
row0keeps all 20 characters'ABCDEFGHIJKLMNOPQRST'(EL 0,ED 0,ECH,ICH, andDCHare no-ops whens->cx > sx - 1inscreen-write.c).cpr(CSI 6 n) repliesb'\x1b[1;21R'(cols + 1, froms->cx + 1ininput.c).LF,IND,RI, andVPAat phantom column preservecx == colsso a following printable character wraps onto the row below;DECRCclampscxtocols - 1;CBTsteps back fromcolsto the prior tab stop.il(IL/DLmid-line) preservescx((' x', 'abcdef')) instead of resettingcxtoleft.capture-pane -estreams containing bareSO(0x0e) render DEC Special Graphics box-drawing (default_g1_charset = "0"onTMUX_PROFILE).Profile.tmux_versiondistinguishestmux <= 3.8(REPno-op atcx == cols; unblankedICH/DCH/ECHon wide-glyph right half) from post-3.8upstreamtmux(b03b71fscreen_write_clear_paddingand8b95395REPwrap).
Actual
row0: 'ABCDEFGHIJKLMNOPQRS ' (column 19 erased), cpr: b'\x1b[1;20R', and il: ('x', 'abcdef').
Environment
libvt:#2(feat/v2-architecture,0.1.0a0)- Python:
3.15.0(unicodedata17.0.0) - Reference
tmux:3.8a(tmux -f /dev/null) - OS: Linux
x86_64
Proposal
Invariants
The invariants below are load-bearing; everything under Intent is open.
DEFAULT_PROFILEandXTERM_PROFILEpreserve standard DEC/xterm right-marginpending_wrapsemantics (EL 0erasescols - 1,IL/DLreset column toleft,CSI 6 nclamps tocols,G1defaults to'B').TMUX_PROFILEreproduces innertmuxpane emulation for its declaredtmux_version, and documentation distinguishes inner-paneTMUX_PROFILEfrom outer-clientDEFAULT_PROFILE/XTERM_PROFILE(used when feeding attachedtmuxclient output includingdisplay-popupoverlays and borders).
Intent (non-binding)
- Provide a
Profile.tmux(version=...)factory configuring orthogonal positive behavioral fields onProfile(il_dl_resets_col: bool = True,rep_wraps: bool = True,default_g1_charset: Charset = "B") alongsidepending_wrap_phantom_colrather than couplingTerminalbranches to raw version tuples. - Guard
EL 0,ED 0,ECH,ICH,DCH,CBT,LF/IND/RI/VPA,DECRC,CSI 6 n, andIL/DLcursor-column handling onProfilewhile keeping_Rowcell indices strictly in0..cols - 1.
Not doing
- Porting
tmux'sGRID_FLAG_TABhorizontalgrid_reflowimplementation.
References
- Core(feat[vt]): Add sans-I/O VT engine, RLE grid, OSC 7501, input, and ADRs #2
tmuxscreen-write.candinput.c(72c20dc/3.8): https://github.com/tmux/tmux/blob/72c20dc/screen-write.c and https://github.com/tmux/tmux/blob/72c20dc/input.ctmuxwide-character edit cleanup commitb03b71f: tmux/tmux@b03b71ftmuxREPwrap commit8b95395: tmux/tmux@8b95395tmuxgrid.cSO/SIserialization (72c20dc/3.8): https://github.com/tmux/tmux/blob/72c20dc/grid.c
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
Config(feat[tmux]): Model phantom col and versions (#10)
Config(feat[tmux]): Model phantom col and versions (#10)
tony commentedon Nov 23, 2026
Resolved in #2 (
0c7ee41).