fix: use sessionName instead of safeSessionName in tmux commands

This commit is contained in:
2026-03-21 17:42:38 +05:30
parent d92c9623a8
commit 0503c474a8
3 changed files with 46 additions and 4 deletions
+4 -4
View File
@@ -54,14 +54,14 @@ export async function closeMultiModel(options: CloseSessionOptions): Promise<Clo
const safeSessionName = sanitizeName(options.sessionName);
try {
// Check if session exists
const { ok: sessionExists } = await runCommand(["tmux", "has-session", "-t", safeSessionName]);
const { ok: sessionExists } = await runCommand(["tmux", "has-session", "-t", options.sessionName]);
// Kill tmux session if it exists
if (sessionExists) {
await runCommand(["tmux", "kill-session", "-t", safeSessionName]);
instructionsArr.push(chalk.green(`Closed session '${safeSessionName}'`));
await runCommand(["tmux", "kill-session", "-t", options.sessionName]);
instructionsArr.push(chalk.green(`Closed session '${options.sessionName}'`));
} else {
instructionsArr.push(chalk.yellow(`Session '${safeSessionName}' does not exist`));
instructionsArr.push(chalk.yellow(`Session '${options.sessionName}' does not exist`));
}
// Get list of worktrees for this session before killing tmux