Skip to content

Interactive rebase fails to start in multi-root workspaces (.code-workspace) #5299

@ianhattendorf

Description

@ianhattendorf

Description

When a multi-root VS Code workspace (a .code-workspace file) is open, starting an interactive rebase from GitLens does not work. Opening the same repository as a single folder (not via the workspace file) works correctly.

Split out from #5203 — this is a separate, pre-existing issue, not a regression from the #5203 fix (PR #5215). Reported in #5203 (comment).

Steps to reproduce

  1. Open a multi-root workspace via a .code-workspace file that contains the target repository.
  2. Start an interactive rebase from GitLens and pick a commit to reword.
  3. Observe that the rebase never becomes active (git status shows no rebase in progress).
  4. Reload the workspace — the rebase is now active, but no commit message / rebase editor opens.

Suspected root cause

Two independent contributors, both pre-dating the #5203 fix:

  1. Start path — editor command for workspaces. The interactive rebase is run with editor: await getHostEditorCommand(true) as git's sequence.editor (src/commands/git/rebase.ts). For a multi-root workspace, getHostEditorCommand(true) returns code --wait --reuse-window --file-uri="<...>.code-workspace" (src/system/-webview/vscode.ts). Git then invokes that command with the git-rebase-todo file appended. Pointing --file-uri at a .code-workspace with --reuse-window makes VS Code re-resolve the workspace in the window rather than simply open the todo file, which appears to disrupt the --wait handshake / the spawned git rebase process — consistent with "nothing happens, no active rebase" and "reloading makes it start." Single-folder opens take the --folder-uri/plain branch and work. This logic predates the Interactive rebase splitting to new pane for no reason #5203 fix by ~5–6 months.

  2. No startup reconciliation for an already-paused rebase. The Interactive Rebase editor auto-opens only in response to onDidChangeRepository's e.changed('rebase') (src/webviews/rebase/rebaseEditor.ts). There is no activation-time check, so an already-paused rebase present at workspace-load time fires no change event and never auto-opens.

Environment (from reporter)

  • GitLens: pre-release 2026.5.261305
  • VS Code: 1.121.0 (system setup), commit f6cfa2ea2403534de03f069bdf160d06451ed282
  • OS: Windows_NT x64 10.0.26200
  • Git: 2.54.0.windows.1 (per original report)

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions