Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/genie-commands/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,16 @@ async function deriveWindowName(sessionName: string, workspaceDir: string, team?
async function handleReset(sessionName: string, windowName: string): Promise<void> {
const existing = await tmux.findSessionByName(sessionName);
if (existing) {
// Collect all window names BEFORE killing the session
const windows = await tmux.listWindows(existing.id);
console.log(`Resetting session "${sessionName}"...`);
await tmux.killSession(sessionName);
await tmux.killSession(existing.id);
// Delete native team dirs for ALL windows in the session
await Promise.all(windows.map((w) => deleteNativeTeam(w.name)));
} else {
// Session not running — still clean up the current window's team dir
await deleteNativeTeam(windowName);
}
await deleteNativeTeam(windowName);
}

function attachToWindow(sessionName: string, windowName: string): void {
Expand Down