Unified sidebar doesn't set sideBarFocus context key

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Unified sidebar doesn’t set sideBarFocus context key — keybindings with when: sideBarFocus never trigger

When using Cursor’s unified sidebar (workbench.parts.unifiedsidebar), the VSCode-standard context key sideBarFocus is never set to true, which breaks keybindings that use when: sideBarFocus.

Root cause (from source analysis):

The regular sidebar part (workbench.parts.sidebar) passes a sideBarFocus context key binding to its super constructor:

super("workbench.parts.sidebar", {...}, ..., a4f.bindTo(d), PTe.bindTo(d), "sideBar", "viewlet", ...)

But the unified sidebar constructor skips this entirely:

super("workbench.parts.unifiedsidebar", {hasTitle: false}, e, t, i)

No focus context key is registered for the unified sidebar, so sideBarFocus stays false even when it has focus.

Impact:

  • Any user keybinding with when: sideBarFocus silently stops working
  • VSCode extensions that rely on sideBarFocus for their keybindings also break
  • No alternative context key (e.g. unifiedSidebarFocus) is provided

Expected behavior:

Either:

  1. Set sideBarFocus to true when the unified sidebar has focus (backward-compatible with VSCode keybindings), or
  2. Provide a new unifiedSidebarFocus context key and document it

Repro:

  1. Add to keybindings.json:
    {“key”: “shift+2 l”, “command”: “workbench.action.focusActiveEditorGroup”, “when”: “sideBarFocus”}
  2. Click the sidebar to focus it
  3. Press @ l — nothing happens
  4. Enable "Developer: Toggle Keyboard Shortcuts Troubleshooting" — log shows: From 1 keybinding entries, no when clauses
    matched the context.
  5. Change when clause to !editorFocus — it works

Workaround: Use !editorFocus && !terminalFocus && !panelFocus instead of sideBarFocus, but this is ugly since I already have a lot of keybindings not using these hacks.

Steps to Reproduce

See above

Expected Behavior

See above

Operating System

MacOS

Version Information

Version: 2.7.0-pre.119.patch.0
VSCode Version: 1.105.1
Commit: f947fde72906f7ead2baf0a913c587bbb5bf3b80
Date: 2026-03-23T05:49:10.648Z
Build Type: Stable
Release Track: Nightly
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, great bug report with a solid root cause analysis.

This is a confirmed bug. UnifiedSidebarPart really doesn’t track focus and doesn’t set sideBarFocus. The related issue with focusActiveEditorGroup was already reported here: workbench.action.focusActiveEditorGroup does not move focus from sidebar when triggered via keybinding, and the root cause is the same.

The team is aware. There’s no timeline yet, but your report and code analysis help prioritize the fix.

The workaround you found !editorFocus && !terminalFocus && !panelFocus is the best option for now. Let me know if you find something better.

1 Like

Thank you for the quick reply! I’ll keep you posted.