From 6d1a542018c9522cd62e99289379c8f4d8fb5004 Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Thu, 22 Oct 2026 19:10:08 +0200 Subject: [PATCH] fix(test): pin that a deleted pane directory is not adopted on rediscovery Merge-time fix for #667. tmux reports the directory of a pane whose directory was deleted while it ran as `/path (deleted)` (tmux 3.4 on Linux). Today the rediscovered session falls back to the server cwd only because isValidPath() rejects the parentheses; this row in the wiring test keeps a later relaxation of the path pattern from quietly adopting a dead directory. Co-Authored-By: Claude Opus 5.5 (1M context) --- test/tmux-manager.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/tmux-manager.test.ts b/test/tmux-manager.test.ts index 39fe2344..cf0889e1 100644 --- a/test/tmux-manager.test.ts +++ b/test/tmux-manager.test.ts @@ -931,6 +931,9 @@ describe('TmuxManager (unit)', () => { 'codeman-dddd4444|105|0|||', // The launch directory every pane starts in; a remote or docker pane never leaves it. 'codeman-eeee5555|106|0|||/tmp', + // A directory deleted while its pane ran, as tmux 3.4 on Linux reports it. isValidPath() + // rejects it for the parentheses; a relaxed path pattern must not adopt a dead directory. + 'codeman-abcd7777|108|0|||/home/user/gone (deleted)', // Last row, path ending in a space: the output must not be trimmed. 'codeman-ffff6666|107|0|||/home/user/trailing ', ].join('\n'); @@ -948,6 +951,7 @@ describe('TmuxManager (unit)', () => { 'restored-cccc3333', 'restored-dddd4444', 'restored-eeee5555', + 'restored-abcd7777', 'restored-ffff6666', ]); const dirs = Object.fromEntries(nonTestManager.getSessions().map((s) => [s.muxName, s.workingDir])); @@ -957,6 +961,7 @@ describe('TmuxManager (unit)', () => { 'codeman-cccc3333': process.cwd(), 'codeman-dddd4444': process.cwd(), 'codeman-eeee5555': process.cwd(), + 'codeman-abcd7777': process.cwd(), 'codeman-ffff6666': '/home/user/trailing ', });