Repository navigation
Description
Summary
VS Code's Windows taskbar jump list is hardcoded to at most 7 entries in its "Recent Folders & Workspaces" custom category, regardless of the slot count Explorer requests through the Windows Shell jump list API.
This is a bug, not a missing feature:
- It violates the Windows Shell jump list contract (
ICustomDestinationList::BeginList/ Electron'sapp.getJumpListSettings().minItems). - It ignores the user's Windows configuration (
Start_JumpListItems), which Explorer surfaces to apps precisely so they can respect it. - The machinery to read it is already in place. VS Code calls
app.getJumpListSettings()and readsremovedItemsfrom the result, but discardsminItemsfrom the same call. - The same jump list is internally inconsistent: VS Code's "Recent" files section (built-in
'recent'category, OS-managed) already honorsminItems. Only the "Recent Folders & Workspaces" custom category, added later, does not. Two adjacent sections in the same jump list behave differently for no documented reason.
Repro
- Make Explorer request more than 7 jump list slots. The simplest way is to set
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_JumpListItemsto a value larger than 7 (e.g. 30), then restart Explorer or sign out and back in. - Open more than 7 distinct folders/workspaces in VS Code.
- Right-click the VS Code taskbar icon.
Expected
The "Recent Folders & Workspaces" category shows up to the slot count Explorer requested, matching the behavior of the "Recent" files section in the same jump list.
Actual
Only 7 entries appear, regardless of what Explorer requested.
Root cause
In src/vs/platform/workspaces/electron-main/workspacesHistoryMainService.ts:
- Line 308 defines
MAX_WINDOWS_JUMP_LIST_ENTRIES = 7. updateWindowsJumpList()callsapp.getJumpListSettings()and reads.removedItemsfrom the result..minItemson the same return value, the slot count Explorer is asking the app to display, is discarded.- The recents list is then sliced with the hardcoded
7before being handed toapp.setJumpList(...).
// Existing code (paraphrased):
for (const item of app.getJumpListSettings().removedItems) { /* ... */ }
// ...
.slice(0, WorkspacesHistoryMainService.MAX_WINDOWS_JUMP_LIST_ENTRIES)The Shell API is already being called. Only half of its return value is being used.
References
- Electron
app.getJumpListSettings()returns{ minItems, removedItems }: https://www.electronjs.org/docs/latest/api/app#appgetjumplistsettings ICustomDestinationList::BeginListreturnspcMinSlots, documented as the slot count Explorer asks applications to populate. The Shell docs state apps "should add at least this number of destinations to the list": https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-icustomdestinationlist-beginlist- Related, closed as not-planned for lack of upvotes: Allow changing the number of recent workspaces in the taskbar jumplist #181129, Windows Jump List Customizations #238605
Proposed fix
Pass jumpListSettings.minItems to the slice call instead of the hardcoded 7, and delete the now-unused constant. The same getJumpListSettings() call already feeds removedItems a few lines above; only minItems needs to be picked up from it.
Environment
- VS Code
mainas of 2026-05-23 - Windows 11 Pro 24H2 (26200)
Activity