From d5a5468b02b298b583ec35d3f7e6c5d4b04afcb5 Mon Sep 17 00:00:00 2001 From: JD Date: Fri, 30 Oct 2026 20:51:46 -0400 Subject: [PATCH] test(tui): check the TUI pid option is unset in a way tmux 3.2a agrees 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. --- test/tui/tui-switch-guard.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/tui/tui-switch-guard.test.ts b/test/tui/tui-switch-guard.test.ts index 917fd670..b867e277 100644 --- a/test/tui/tui-switch-guard.test.ts +++ b/test/tui/tui-switch-guard.test.ts @@ -236,7 +236,9 @@ describe.skipIf(!hasTmux)('TUI M-1..M-9 switch only the attaching client', () => await client.unbindSwitchKey('M-2', tty); await client.disarmTuiSwitchGuard(tty); expect(run(['list-keys', '-T', 'root'])).not.toContain(`switch-client -t ${beta}`); - expect(() => run(['show-options', '-gv', '@codeman-tui-pid'])).toThrow(); + // The listing, not `show-options -gv`: an unset user option is an error on + // tmux 3.5 but empty output and exit 0 on 3.2a. + expect(run(['show-options', '-g'])).not.toContain('@codeman-tui-pid'); // A hook armed for a tty this one is a prefix of (pts/4 vs pts/41) is // another TUI's, and this tty's disarm must leave it.