Skip to content

Commit a677365

Browse files
Merge branch 'new-dmux-pane'
2 parents 1bdf4d4 + 6aa5cb2 commit a677365

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/DmuxApp.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@ const DmuxApp: React.FC<DmuxAppProps> = ({ dmuxDir, panesFile, projectName, sess
5050
// Filter out dead panes
5151
const activePanes = loadedPanes.filter(pane => {
5252
try {
53-
execSync(`tmux list-panes -F '#{pane_id}' | grep -q '${pane.paneId}'`, {
53+
// Get list of all pane IDs
54+
const paneIds = execSync(`tmux list-panes -F '#{pane_id}'`, {
55+
encoding: 'utf-8',
5456
stdio: 'pipe'
55-
});
56-
return true;
57+
}).trim().split('\n');
58+
59+
// Check if our pane ID exists in the list
60+
return paneIds.includes(pane.paneId);
5761
} catch {
5862
return false;
5963
}
@@ -263,6 +267,9 @@ const DmuxApp: React.FC<DmuxAppProps> = ({ dmuxDir, panesFile, projectName, sess
263267
// Switch back to the original pane (where dmux was running)
264268
execSync(`tmux select-pane -t '${originalPaneId}'`, { stdio: 'pipe' });
265269

270+
// Small delay to ensure pane is fully established before re-launching
271+
await new Promise(resolve => setTimeout(resolve, 100));
272+
266273
// Re-launch dmux in the original pane
267274
execSync(`tmux send-keys -t '${originalPaneId}' 'dmux' Enter`, { stdio: 'pipe' });
268275
};

0 commit comments

Comments
 (0)