Repository navigation
Description
Summary
A tab received at the final occupied column cancels pending wrap under the Ghostty profile. The next character overwrites the last character on the line.
Reproduction
-
From the tagged
libvtcheckout, install the locked development dependencies withuv sync --frozen --python 3.14 --all-groups --all-extras. Use the checkout root as the working directory. -
Save the following as
case.pyat the checkout root.
from libvt import Terminal
from libvt.profiles import GHOSTTY_PROFILE
for tail in (b"X", b"\tX"):
terminal = Terminal(rows=2, cols=5, profile=GHOSTTY_PROFILE)
terminal.feed(b"12345" + tail)
print(repr(tail), terminal.committed.lines)
assert terminal.committed.lines == ("12345", "X"), "the tab changed where the next byte printed"- Run the case.
$ uv run --no-sync python case.pyExpected
Keep the pending wrap when the tab has nowhere to move. Both Ghostty 1.0.2 and a real xterm 390 wrap the following character in the measured case.
Actual
The no-tab control wraps X. With the tab inserted, the original last character becomes X.
Environment
Tested versions
libvt v0.0.1a4 and trunk 0864aa2, CPython 3.14.6, Linux ARM64 on WSL2.
Evidence
Observed output
b'X' ('12345', 'X')
b'\tX' ('1234X', '')
Independent application or native control
right edge with tab libvt ('1234X', '') Ghostty ('12345', 'X')
Proposal
Preserve pending wrap on a right-edge horizontal tab for the host profiles with this behavior. Retain independent cases for a genuine move to the next tab stop.
- Developer experience — Terminal-layout tests can exercise narrow, edge-aligned columns without special-casing tabs.
- Immediate benefit — Add a byte-for-byte comparison that types a character after the tab.
- Longer-term benefit — Host conformance coverage will include deferred wrap transitions and their subsequent visible effects.
- End-user experience — A tab-separated status row retains its last character when it exactly fills the viewport.
Activity
tony commentedon Dec 3, 2026
At the right edge, a forward tab now keeps deferred wrap until the next printable. In the 2×5
123界fixture, HT followed by X leaves the first row intact and puts X at row 1, column 0. The native checks include Ghostty VT 1.0.2 and XTerm 390. PR #184