Don't apply the worktree default when resuming a session#62
Open
ymajoros wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A plain click on a session in the sidebar does nothing — no terminal appears, the session stays "inactive" — yet Resume with config works. So a session can only be interacted with through the config dialog.
Cause
openSession()resumes withresolveDefaultSessionOptions(), which is shared with new-session creation and includes the globalworktree: truedefault. Resuming an existing session with--worktreetries to spin it up in a fresh git worktree and fails to attach, so the terminal never shows.showResumeSessionDialog()has no worktree control and never sets the flag — which is exactly why "Resume with config" works. Plain click and the dialog should behave the same.Fix
Strip
worktree/worktreeNamefrom the resolved options on the resume path inopenSession():New-session creation is untouched (still honors the worktree default). Worktree is a new-session concept — resuming must reuse the session's existing directory.
Testing
Built locally (Electron 41, Linux) with
worktree: trueas the default: plain click now resumes in place and attaches, matching the dialog. New-session-in-worktree still works.