From f3ed37230d449f9f62332ccf7993c830f5d644d1 Mon Sep 17 00:00:00 2001 From: Yannick Majoros Date: Mon, 1 Jun 2026 15:59:07 +0200 Subject: [PATCH] Don't apply the worktree default when resuming a session MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resolveDefaultSessionOptions() is shared by new-session creation and resume. The `worktree: true` global default makes sense only for NEW sessions (start in a fresh isolated git worktree). On resume it's wrong: a plain click on a session resolves to {worktree:true}, so it tries to resume the existing session into a brand-new worktree and fails to attach — the terminal never shows and the session looks stuck "inactive". "Resume with config" works only because the resume dialog has no worktree control and never sets it. Strip worktree/worktreeName from the resolved options on the resume path so plain click resumes in place, matching the dialog. --- public/app.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/app.js b/public/app.js index 9ab01b8..ef441f4 100644 --- a/public/app.js +++ b/public/app.js @@ -793,6 +793,11 @@ async function openSession(session, customOptions) { // Open terminal in main process const resumeOptions = customOptions || await resolveDefaultSessionOptions({ projectPath }); + // The `worktree` default applies to NEW sessions only. Resuming must reuse the + // session's existing directory, so never pass --worktree on resume — otherwise + // a plain-click resume tries to spin up a fresh git worktree and fails to attach + // (the Resume-with-config dialog already omits worktree, which is why it works). + if (resumeOptions) { delete resumeOptions.worktree; delete resumeOptions.worktreeName; } const result = await window.api.openTerminal(sessionId, projectPath, false, resumeOptions); if (!result.ok) { entry.terminal.write(`\r\nError: ${result.error}\r\n`);