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:
Get x and y the right way round, fixes crash when opening a mode prompt when the client is offset into the window; may be the crash reported by sthen@.
* 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:
Do not do anything in session_detach and rely on the caller destroying the session, otherwise grouped sessions can reuse a session with no windows. From Jeong, Heon in GitHub issue 5620.
* refs/remotes/tmux-openbsd/master:
Add support for borderless menus, like panes. GitHub issue 5447 from harikp2002 at gmail dot com.
Do not trim all lines to make a zero line grid which reflow does not like, from Kaixuan Li.
Do not unzoom when resizing a floating pane that was created with -A. Similarly, skip hidden floating panes when changing Z order. Reported by Clark Wang.
* refs/remotes/tmux-openbsd/master:
Remove popups and all the associated overlay machinery (they were the last user of it). display-popup stays but becomes an (undocumented) compatibility command to open a floating pane.
Fix typo (too few 0s) in CLIENT_CONTROL_DISCARD, from someone in GitHub issue 5622.
* refs/remotes/tmux-openbsd/master:
build tmux with debug symbols, ok claudio nicm
If no floating panes, reset default starting position, and reset if any part of the pane goes outside the window.
Empty string for invalid old-style formats causes old iTerm2 versions to crash, so emit "0000," instead.
Fix session_*_flag format variables which loop over the windows (they should only be false if all windows do not have the flag, not the first one). GitHub issue 5599.
Do not loop forever if someone tries to give WCHAR_MAX a width, GitHub issue 5602.
Expand -c for run-shell like the other -c flags, reported by Saúl Nogueras.
Reset layout manually instead of calling window_unzoom which can go down the notification path and end up double freeing the pane (this was previously removed in 2015 but added back to fix a problem with late destroy - this is a better fix). GitHub issue 5591 from Romain Francoise.
notification path and end up double freeing the pane (this was previously
removed in 2015 but added back to fix a problem with late destroy - this is a
better fix). GitHub issue 5591 from Romain Francoise.