nicm is opposed to identifying a terminal via an environment variable, so
remove the WindowsTerminal tty_default_features() entry and the
WT_SESSION check in tty_term_create() entirely, pending some other
accepted identification mechanism for Windows Terminal (it cannot be
identified via the existing XTVERSION path at all - see the previous
commit's now-removed comment for why).
This leaves WezTerm and ghostty's margins grants in place - both are
identified via the existing, already-accepted XTVERSION mechanism, with
DECSLRM support confirmed directly in their own source, independent of
this change.
regress/tty-margins-wt-session.sh tested only the removed mechanism and
is replaced by regress/tty-margins-scrollbar.sh, which checks the same
underlying scrollbar/margins scroll-decision mechanism (still real, and
still what WezTerm's and ghostty's table entries rely on) via the
generic terminal-features option instead of simulating any one
terminal's identification handshake.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Any pane that doesn't span the terminal's full width - because
pane-scrollbars is on (the scrollbar occupies a column) or the pane is one
of a side-by-side split - needs DECSLRM (left/right margin) support to use
the fast native-scroll path (tty_cmd_linefeed()/scrollup()/scrolldown()/
reverseindex(), tty.c: "(!tty_full_width(tty, ctx) && !tty_use_margin(tty))").
Without it, every single scroll falls back to tty_redraw_region()'s full
manual repaint of the whole region - confirmed via -vv log
("tty_redraw_region: ... large region redraw") - which is a real source of
flicker, and separately implicated in reports of image content not
surviving a scroll in this area of the tree.
The DECSLRM machinery itself (tty_margin_pane()/tty_margin()) is already
built and already called from all four native-scroll dispatch functions.
What was missing was terminal-capability coverage:
- WezTerm and ghostty are already correctly identified via the existing
XTVERSION mechanism (tty_keys_extended_device_attributes(),
tty-keys.c), and both genuinely implement DECSLRM - confirmed directly
in their own source (WezTerm: decslrm() in csi.rs, documented in their
escape-sequences reference, a changelog entry fixing a DECSLRM bug
confirming active use; ghostty: handled in dcs.zig/stream.zig,
explicitly emitted alongside DECSTBM in their own formatter.zig, with
its own terminfo entry for it). Neither's entry in
tty_default_features()'s table (tty-features.c) granted "margins".
This was a gap, not a detection problem, backed by source-level
evidence rather than guesswork - kitty and Rio show zero DECSLRM
references in their own source, so their omission is left as-is.
- Windows Terminal's DECSLRM support was independently confirmed by
direct, non-tmux escape-sequence testing, but it can never be
identified via XTVERSION - the tracking issue for that
(github.com/microsoft/terminal#18382) was explicitly closed
not_planned by the maintainer, calling XTVERSION "not extensible or
helpful for feature detection". Detected instead via the WT_SESSION
environment variable Windows Terminal sets for every child process -
a long-standing, stable signal already used for this exact purpose by
many other tools. Checked in tty_term_create() (tty-term.c) alongside
the existing COLORTERM-based RGB/256 detection, which already reads a
named variable out of the attaching client's own environment
(c->environ, populated via the MSG_IDENTIFY_ENVIRON handshake) the
same way. Deliberately grants only "margins" for now, not the full
modern-xterm feature bundle other entries get, since no other
capability has been verified for it.
New regress/tty-margins-wt-session.sh reproduces the scrollbar-pane
scenario with WT_SESSION injected into the attaching client's environment
and checks, via the -vv log, that no tty_redraw_region() fallback occurs -
plus a sanity phase confirming the same scenario does fall back without
WT_SESSION set, proving the test isn't accidentally trivial. Verified
failing 3/3 against the pre-fix code and passing 5/5 standalone; full
regress suite passes clean twice, with only pre-existing, unrelated
failures (check-names.sh - confirmed identical on unmodified master;
prompt-words-history.sh - already-known flake; four untracked
image-*-noflash scratch tests left over from unrelated work on another
branch, not part of this tree's tracked suite).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* refs/remotes/tmux-openbsd/master:
Some terminals have extended DECSCUSR to allow it to reset to the default style and put that as the Se capability in their terminfo entry. Change so that if Ss and Se exist, tmux does not overwrite them with its own. GitHub issue 5476.
default style and put that as the Se capability in their terminfo entry.
Change so that if Ss and Se exist, tmux does not overwrite them with its
own. GitHub issue 5476.
* refs/remotes/tmux-openbsd/master:
Add a feature for mintty's application escape to avoid dodgy terminals whinging about not supporting it, GitHub issue 5626 from Pete Dietl.
Only rely on the previous line wrapping when the cursor is actually on it, GitHub issue 5625 from Ben Maurer.
Correctly write Z indexes to v2 layouts if zoomed, GitHub issue 5624.
Do not leak waiting clients (in wait-for) if they are killed, GitHub issue 5614.
* refs/remotes/tmux-openbsd/master:
If writing a file fails, propagate the error to the server via a new message. Use a client flag rather than bumping the protocol version. GitHub issue 5451.
Add default terminal features for Rio, GitHub issue 5489 from Raphael Amorim.
* refs/remotes/tmux-openbsd/master:
build: don't exit
build: always attempt portable merge
build: capture openbsd-base before filtering
build: fetch cutover master before merge
Use _exit in child after fork, from Yayo Razo in GitHub issue 5376.
Add missing calloc check and use fatal. Prompted by a similar change from Yayo Razo.
actions: use published openbsd-git as base update
github actions: automate updates
Do not make pty fds blocking again until all the data has been consumed or control mode clients can get stuck, GitHub issue 5356 from Ben Maurer.
Add formats and events for OSC 133 commmands, as well as a -T flag to set-hook -B to only fire when the format is true.
Replace the notification system with events. Events can carry a payload of additional payload (to reduce problems with lifetime of objects) and are delivered to one or more event sinks. This is more powerful and reduces the complex dependencies between control mode and hooks. Events are now used for hooks, control mode notifications and for monitors (set-hook -B).
additional payload (to reduce problems with lifetime of objects) and are
delivered to one or more event sinks. This is more powerful and reduces the
complex dependencies between control mode and hooks. Events are now used for
hooks, control mode notifications and for monitors (set-hook -B).
wait-for can now wait for an event to fire (-E flag, with -F to for filter),
with -v to print the payload, as well as listing (-l) waiting clients on an
event and forcing one to wake (-w).
A few additional hooks are also now available (pane-created, pane-resized, etc)
and some of the existing ones have additional format variables available.
mode 2 as well as mode 1. From Stanislav Kljuhhin (GitHub issue 4038).
This changes tmux to always request mode 2 from parent terminal, change
to an unambiguous internal representation of keys, and adds an option
(extended-keys-format) to control the format similar to the xterm(1)
formatOtherKeys resource.
terminals such as iTerm2). Originally written by me then extended and
completed by first Will Noble and later Jeff Chiang. GitHub issues 911,
2621, 2890, 3240.