Repository navigation
test(tui): check the TUI pid option is unset in a way tmux 3.2a agrees with - #742
JDProfresh wants to merge 1 commit into
Conversation
…s with An unset user option makes `show-options -gv` exit 1 on newer tmux but print nothing and exit 0 on 3.2a (Ubuntu 22.04), so the disarm assertion failed there although the option was gone. Assert on the global listing instead, which omits an unset option on both.
|
Thanks @JDProfresh for tracking this down. The PR makes I ran it here on tmux 3.4: the file passes, the whole Nothing to change. This merges as it stands once the remaining CI job finishes. Thanks again for the clear write-up and the tmux version table. |
test/tui/tui-switch-guard.test.tsasserts thatdisarmTuiSwitchGuard()removed the@codeman-tui-pidoption by expectingtmux show-options -gv @codeman-tui-pidto throw, but on tmux 3.2a an unset user option is not an error: it prints nothing and exits 0. Sonpm testis red on Ubuntu 22.04 even though the option is gone.Problem
On a clean 1.47.0 (
f1f7eec4) on Ubuntu 22.04 with its packaged tmux 3.2a:CI stays green because its ubuntu-24.04 runners have a newer tmux. The line came in with the #688 release-prep review (
46774b71).Cause
The same
show-options -gvon an unset user option, on a private socket:invalid option: @codeman-tui-pidThe code under test already handles both:
disarmTuiSwitchGuard()treats a thrown read and an empty one alike (if (!pid) return;). Only the test depends on the version.What it does
The assertion reads the global option listing,
show-options -g, and expects@codeman-tui-pidto be absent. On both versions the listing contains@codeman-tui-pid 123while the option is set and leaves it out onceset-option -guhas run. That matches thelist-keysandshow-hooksabsence checks the same test already uses. Nothing outside the test changes.Tests
npm test -- test/tui/tui-switch-guard.test.tson tmux 3.2a: red on 1.47.0, green 3 of 3 with the change.set-option -gu @codeman-tui-pidcall indisarmTuiSwitchGuard()commented out, the new assertion fails (expected '@codeman-tui-pid 1671450\n…' not to contain '@codeman-tui-pid').npm test13,504 passed (13,503 plustest/frontend-public-tooling.test.ts, which needed the spreadsheet preview assets generated in my fresh worktree and passes 4 of 4 after that).