Never Untitled
Tell your VS Code windows apart at a glance.
The Dock, the taskbar, Alt-Tab and Mission Control stop showing
five windows called "Visual Studio Code" or just "main".

Why this extension
VS Code's built-in title variables and the existing window-title extensions
fall short in these cases:
- Title goes blank on a chat, Welcome or Settings tab → keeps the last folder you worked in.
- Only the first folder of a multi-root workspace counts → follows the folder of the active file.
- No branch in a subfolder of a repo, a worktree or a submodule → finds
.git itself by walking up.
- Nothing on a detached HEAD → shows the short commit sha.
- No branch in Restricted Mode (untrusted folders) → only reads folder names and
.git/HEAD, so it can stay on.
- Writes the title into
.vscode/settings.json, which then shows up in git status → writes no settings at all.
- Polls, or runs
git on every editor switch → watches .git/HEAD and runs no processes.
Setup
Nothing to set up. Once installed, the window title becomes:
${neverUntitledName}${separator}${neverUntitledBranch}
${separator} only appears between two non-empty parts. So a folder without
git reads notes, and a repository reads webshop — main.
This is a new default for window.title, not a change to your settings files:
- If you already set your own
window.title, yours wins. Add the variables
below to it.
- If you uninstall or disable the extension, VS Code's own default title comes back.
- Settings Sync leaves your other machines alone.
| Variable |
Value |
${neverUntitledName} |
Name of the workspace folder that holds the active file. On a tab that is not a file, it keeps the last folder you worked in. Before that, it is the first workspace folder. |
${neverUntitledBranch} |
Git branch of that folder, or the first 8 characters of the commit on a detached HEAD. Empty outside git. |
${neverUntitledRepo} |
Name of the repository's top-level folder. Differs from the name when you open a subfolder of a repo. Empty outside git. |
To make your own title, set window.title in your User Settings and mix them
with VS Code's own variables, for example:
"window.title": "${dirty}${neverUntitledName}${separator}${neverUntitledBranch}${separator}${activeEditorShort}"
How it works
VS Code has a workbench command, registerWindowTitleVariable(name, contextKey), that binds a ${name} title variable to a context key. Never
Untitled registers three variables and sets their context keys with
setContext. VS Code redraws the title whenever one of them changes. The
default title comes from a configurationDefaults entry in package.json.
That command is part of VS Code's workbench, not of the documented extension
API. Other extensions use it too, but a future VS Code release could change
it. If that happens, the variables stay empty and the rest of your title still
shows.
Requirements: VS Code 1.93 or later. Branch detection reads .git on the
local disk. In a remote window (SSH, WSL, Dev Containers) the folder name works,
but the branch stays empty.
Build from source
No npm or vsce needed:
./build-vsix.sh /tmp/never-untitled && code --install-extension /tmp/never-untitled/*.vsix --force
test/make-testbed.sh creates one folder per case in the screenshot above.
That covers a repo, a folder without git, a subfolder of a repo, a submodule
and a detached HEAD. Open each one in its own window to check the titles.
License
MIT with the Commons Clause: free to use,
change and share, also at work, but not to sell without permission. See
LICENSE.