Window.title ${activeRepositoryBranchName} renders empty in git worktree windows (regression)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Environment

  • Cursor 3.12.17, macOS (Darwin 25.5.0), Apple Silicon
  • git 2.50.1 — all worktree commands resolve correctly at the CLI
    (rev-parse --show-toplevel/--git-dir/--git-common-dir, rev-parse --abbrev-ref HEAD)
  • A set of linked git worktrees, each opened as its own window

Summary

Opening a git worktree folder leaves the ${activeRepositoryBranchName} window-title
variable empty, so "window.title": "${activeRepositoryBranchName}${separator}${rootName}"
shows only the folder name. ${activeRepositoryName} is empty too. This worked before and
regressed after a recent update. A normal (non-worktree) clone shows the branch fine.

Steps to reproduce

  1. git worktree add ../wt-feature feature/my-branch
  2. Open ../wt-feature as a folder in Cursor
  3. In user settings.json: "window.title": "${activeRepositoryBranchName}${separator}${rootName}"
  4. Focus a source file; open the Source Control panel

Expected: title shows feature/my-branch — wt-feature
Actual: title shows only wt-feature; the branch variable is blank

Evidence

From logs/<session>/window<N>/exthost/vscode.git/Git.log:
[Model][openRepository] Opened repository: ~/wt-feature
[Model][openRepository] Opened repository (kind): worktree
[Git][getWorktreesFS] Worktree detection is disabled, skipping worktree detection
[Git][revParse] Unable to read file: ENOENT, open
‘~/myrepo/.git/worktrees/wt-feature/refs/remotes/origin/feature/my-branch’
revParse reads refs from the per-worktree gitdir (.git/worktrees/<name>/refs/...)
instead of the common dir (.git/refs/...), so it ENOENTs every refresh. It falls back
to the git CLI (so this line is only a warning), but the SCM history provider’s
historyItemRef that feeds ${activeRepositoryBranchName} never gets populated.

Notes

  • Also affects ${activeRepositoryName} (empty).
  • Workspace/folder-scoped window.title in .vscode/settings.json is not applied to
    the title bar (only the user-global window.title is honored), so a per-worktree static
    title workaround doesn’t work either.
  • Related upstream: microsoft/vscode #251596 and #267612.

Steps to Reproduce

  1. git worktree add ../wt-feature feature/my-branch
  2. Open ../wt-feature as a folder in Cursor (its own window)
  3. In user settings.json set:
    “window.title”: “${activeRepositoryBranchName}${separator}${rootName}”
  4. Focus a source file, and open the Source Control panel (Cmd+Shift+G)
  5. Reload the window (Cmd+Shift+P → Reload Window)

Expected Behavior

The title bar shows the branch, e.g. feature/my-branch — wt-feature
(as it does for a normal, non-worktree clone, and as it did before a recent update).

Screenshots / Screen Recordings

cursor-title.png

Operating System

MacOS

Version Information

Cursor 3.12.17 (commit 0fb762053c34788bb7760d5673f8a6d4c8589d50, VS Code 1.128.0)

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hi @evan.fuller!

Thanks for the report. I couldn’t reproduce this on 3.12 after following your steps. I also hit [Git][revParse] ENOENT .git/worktrees/…/refs/remotes/origin/… in the logs, yet the title rendered correctly, so I’d consider it a red herring for now.

A couple of thoughts:

  1. Are you sure your settings.json isn’t being overridden somewhere? You might want to try configuring it like "window.title": "test${separator}${rootName}", just to make sure your changes are taking effect.
  2. Try running git worktree repair && git worktree prune in the main checkout.

Colin- thanks for the quick response! I had to dig in more to identify what was really going on.

You’re right that it’s not a window.title bug — thanks for checking. document.title
and the .window-title element both show the full branch correctly. I mis-scoped it.

The real issue is a different element, specific to the compact / no-title-bar
layout (cursor.noTitlebarLayout.enabled):

In that layout the auxiliary-bar workspace header (.auxiliary-bar-workspace-name)
is what’s visible, and per the code it’s populated by:

updateWorkspaceName() {
  const t = this.labelService.getWorkspaceLabel(workspace, { verbose: 0 }) || "";
  this.workspaceNameElement.textContent = t;
}

i.e. the workspace label (folder basename), not window.title.

Feature request: have that workspace header respect window.title (or expose a
setting / title variable for it). Motivation: with git worktrees you keep fixed
folders (myrepo-wt-1/2/3) and encode the branch in window.title. The title bar
shows the branch fine, but the compact Agents Window header always shows the folder
name, so every worktree window is indistinguishable there.

Repro: open a worktree folder, enable the compact/no-title-bar layout, set a
distinctive window.title — the auxiliary-bar workspace header still shows the folder
name.

That tracks with what I’m seeing! I’ll file it for the team, but no ETA to share!