Repository navigation
Description
Summary
capture-pane on tmux 3.4 emits an extra space after an airplane plus emoji presentation selector. Libvt imports that space and certifies the shifted neighbor as exact.
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. Install the tmux version in Environment. SetTMUX_BINto its executable when using a version outside your search path. -
Save the following as
case.pyat the checkout root.
import contextlib
import os
import subprocess
import tempfile
import time
from pathlib import Path
from libvt.contrib.tmux import build_tmux_capture_command, tmux_profile
def until(read, check):
end = time.monotonic() + 6
while True:
value = read()
if check(value):
return value
if time.monotonic() >= end:
raise AssertionError(f"native wait expired at {value!r}")
time.sleep(0.02)
@contextlib.contextmanager
def pane(width=24, height=6):
binary = os.environ.get("TMUX_BIN", "tmux")
version = subprocess.check_output([binary, "-V"], text=True).strip()
with tempfile.TemporaryDirectory() as tmp:
pipe = Path(tmp) / "log"
os.mkfifo(pipe)
argv = [binary, "-u", "-S", tmp + "/socket", "-f", "/dev/null"]
def tm(*args):
return subprocess.check_output([*argv, *args], timeout=6, stderr=subprocess.PIPE)
def capture():
bundle = build_tmux_capture_command("%0", tmux_version=version)
return bundle.parse(tm(*bundle.argv), profile=tmux_profile(version))
tm("new-session", "-d", "-x", str(width), "-y", str(height), "-s", "desk", "cat", str(pipe))
try:
tm("set", "-g", "status", "off")
tm("set", "-w", "window-size", "manual")
tm("resize-window", "-t", "%0", "-x", str(width), "-y", str(height))
with pipe.open("wb", buffering=0) as feed:
yield tm, feed.write, capture, argv, version
finally:
subprocess.run([*argv, "kill-server"], capture_output=True, check=False)
with pane() as (tm, write, capture, argv, version):
write("✈️Z".encode())
until(lambda: tm("capture-pane", "-p"), lambda b: b"Z" in b)
result = capture()
native_col = int(tm("display-message", "-p", "-t", "%0", "#{cursor_x}")) - 1
col = next(i for i, cell in enumerate(result.snapshot[0]) if cell.text == "Z")
print("native Z column", native_col, "captured Z column", col, "exact", result.completeness.exact_cells)- Run the case.
$ uv run --no-sync python case.pyExpected
A pane capture can expose this native limitation to consumers comparing individual cells.
Actual
The native cursor places Z at zero-based column 2. In the captured snapshot Z is at column 3 and exact_cells is true. This build-specific behavior begins in the native capture stream.
Environment
Tested versions
libvt v0.0.1a4 and trunk 0864aa2, Linux ARM64 on WSL2, tmux 3.4, CPython 3.14.6.
Evidence
Observed output
native Z column 2 captured Z column 3 exact True
Proposal
Qualify cell-exactness for affected combinations of server version, captured text and Unicode width. Add a control with an ordinary two-cell glyph and compare the pane cursor and visible client.
- Developer experience — Developers can identify when they need an attached-client screen to check layout.
- Immediate benefit — Expose the known loss instead of silently approving a shifted glyph.
- Longer-term benefit — Make per-version Unicode fidelity auditable independently of libvt’s own renderer.
- End-user experience — A click or assertion on the text after the icon can use accurate coordinates or explicitly choose a live view.
Activity
tony commentedon Dec 3, 2026
In tmux 3.4, the native pane and the attached client both placed the neighbor of the VS16 glyph at column 2. Modern-width capture placed it at 3 and reported the uncertain column. In tmux 3.7 all three paths put the neighbor at 2. A CJK control agreed across both servers.
The decoder can report the uncertainty for old servers. The selected server version comes from the parent capture fix. PR #174
tmux(fix[capture]): Flag uncertain emoji widths