Custom Logo for VS CodeShows a per-project icon for VS Code in the OS window switcher (Alt+Tab / Cmd+Tab) — so when you have five VS Code windows open, you can tell projects apart at a glance. Drop a PNG into your project as Platform support
InstallationFrom a
|
| Where | What | Reverted by |
|---|---|---|
Linux: ~/.local/share/icons/hicolor/*/apps/vscode.png |
User-local theme override with the project logo | Closing the window / the Restore command — files are deleted and the packaged icon returns |
| Linux: icon theme setting | Briefly toggled to another theme and back to force GNOME to refresh (≤1s) | Automatic — the original theme is always restored |
| Windows: the window itself | WM_SETICON with the project icon |
Restore command / closing the window |
Windows: project's .vscode/settings.json |
window.title template — only if the project does not define its own window.title |
Removed automatically when the extension is disabled/uninstalled or the setting no longer applies |
To revert everything manually, run Custom Logo: Restore Default Icon and Title, then uninstall the extension.
Settings
| Setting | Default | Description |
|---|---|---|
customLogo.enabled |
true |
Enable the per-project window icon. |
customLogo.iconPath |
"" |
PNG path, relative to the workspace root or absolute. Empty = use .vscode/logo.png. |
customLogo.setWindowTitle |
true |
Windows only: rewrite window.title in workspace settings. Skipped if the project defines its own title. |
customLogo.titleTemplate |
${folderName}${separator}${activeEditorShort} |
Template written to window.title on Windows. |
customLogo.linux.method |
auto |
iconTheme (= auto, refreshes live) or desktopFile (only applies after a full VS Code restart on GNOME). |
customLogo.linux.forceShellRefresh |
true |
GNOME: briefly toggle the icon theme to force the shell to drop its icon cache. Short flicker when the icon changes. |
customLogo.linux.iconName |
"" |
Icon name to override (code, vscode, codium...). Only for the iconTheme method. Empty = auto-detect. |
Commands
Custom Logo: Apply Icon NowCustom Logo: Restore Default Icon and Title
Troubleshooting
- Nothing happens: make sure you reloaded the window after installing, and check the Custom Logo output channel for errors.
- Linux, icon changes late or never: keep
customLogo.linux.forceShellRefreshenabled on GNOME — without it the shell shows its cached icon. ThedesktopFilemethod only applies after a full VS Code restart. - Snap/Flatpak builds keep their desktop files outside the standard lookup chain — use the
.debbuild of VS Code. - Windows, icon does not change: the helper needs PowerShell (
powershell.exe). If your environment blocks scripts entirely,ExecutionPolicy Bypassper-process is used, but restrictive AppLocker policies may still interfere — check the output channel. - VS Code Insiders / VSCodium / OSS builds: detected automatically; the
desktopFilemethod follows the packaged desktop file, theiconThememethod followscustomLogo.linux.iconNameif auto-detection picks the wrong name.
How it works (Linux)
There is no API (especially on Wayland) to change a running window's icon, and GNOME Shell caches app icons aggressively. The combination that refreshes live (verified on Ubuntu GNOME/Wayland):
- The project PNG is written as a user-local icon-theme override:
~/.local/share/icons/hicolor/{256x256,48x48}/apps/<name>.png, where<name>is the icon name from VS Code's packaged desktop file (auto-detected, e.g.vscode). System files are never touched. gtk-update-icon-cacherebuilds the theme cache.- The trick: the system icon theme is briefly toggled to another theme and back (
gsettings ... icon-theme), which forces GNOME Shell to drop its in-memory icon cache and re-resolve — the new icon appears immediately. This causes a short icon flicker and only happens when the icon actually changes (content hash is tracked); disable viacustomLogo.linux.forceShellRefresh. - On exit the override files are deleted and the stock icon returns.
An alternative desktopFile method (user-local copy of the .desktop file with an absolute Icon= path) is available via customLogo.linux.method — note GNOME does not re-read the desktop file of an already running app, so it only takes effect after a full VS Code restart.
How it works (Windows)
Windows Alt+Tab shows the window icon, which can be changed at runtime by sending WM_SETICON to the window's HWND:
- The extension wraps your project PNG into an
.icocontainer (ICO supports PNG payloads — no re-encoding). - It briefly puts a unique marker into the window title, and a bundled PowerShell helper (
native/win/Set-WindowIcon.ps1, no extra installs — PowerShell ships with Windows) finds this exact window by that marker (all VS Code windows share one process, so PID matching is impossible) and sendsWM_SETICONwith the icon loaded viaLoadImage(..., LR_LOADFROMFILE | LR_SHARED), so the icon stays valid after the helper exits. - The stock icon (extracted once from
Code.exe) is set back on restore.
Why not macOS
The Cmd+Tab icon is the application icon (NSApplication.applicationIconImage), which lives in VS Code's main process. Extensions run in a separate extension-host process and have no way to reach it — there is no API for this. The only workaround (rewriting Code.icns inside the .app bundle) breaks the app's code signature and is reverted by every update, so it is deliberately not implemented.
Development
npm install
npm run compile # or: npm run watch
npm test # unit tests for the non-VS-Code logic
Press F5 in VS Code to launch an Extension Development Host.
Roadmap
- Linux/X11: true per-window icons via
_NET_WM_ICON(helps KDE/XFCE window switchers). - Windows: fall back to a compiled helper if PowerShell is locked down by policy.
- Marketplace publishing.
License
MIT (see LICENSE file).