Skip to content

Graph sidebar: Ctrl+Shift+P and other keyboard shortcuts blocked by tree type-ahead search #5225

@nikolay-1986

Description

@nikolay-1986

Summary

When focus is inside a Graph sidebar panel (Agents, Worktrees, Branches, Remotes, Stashes, Tags — anything except Overview) with a selected tree item, Ctrl+Shift+P does not open the Command Palette. Other modifier-based keyboard shortcuts using printable characters are likely affected as well. The issue does not reproduce on non-Latin keyboard layouts (e.g. Russian), only on English/Latin layouts.

Impact

Users lose access to the Command Palette and potentially other VS Code keyboard shortcuts while interacting with the Graph sidebar tree views.

Root Cause

The gl-tree-generator component's type-ahead search handler (handleContainerKeydown in src/webviews/apps/shared/components/tree/tree-generator.ts:993-1000) calls preventDefault() and stopPropagation() for any key matching /^[a-zA-Z0-9\s\-_.]$/ without checking for modifier keys (Ctrl, Meta, Alt).

On an English keyboard layout, Ctrl+Shift+P produces event.key === "P", which matches the regex and gets swallowed by the type-ahead handler. On a Russian layout, Ctrl+Shift+P produces a Cyrillic character for event.key that does not match the regex, so the event propagates normally.

// tree-generator.ts:993-1000
default: {
    if (this.isPrintableCharacter(e.key)) {
        e.preventDefault();     // blocks the shortcut
        e.stopPropagation();    // prevents VS Code from seeing it
        this.handleTypeAhead(e.key);
        return;
    }
    break;
}

Validation

  1. Open the Commit Graph with gitlens.graph.experimentalFeatures.enabled: true
  2. Open any sidebar panel except Overview (e.g. Branches)
  3. Click on a tree item to give it focus
  4. Press Ctrl+Shift+P — Command Palette does not open
  5. Switch to a non-Latin keyboard layout and press Ctrl+Shift+P — Command Palette opens

Risk

The fix scope is limited to adding a modifier-key guard in the type-ahead handler. No impact on type-ahead search functionality since type-ahead should only activate on plain character input without Ctrl/Meta/Alt modifiers.

VSCode Version

Version: 1.120.0 (user setup)
Commit: 0958016b2af9f09bb4257e0df4a95e2f90590f9f
Date: 2026-05-12T20:17:22Z
Electron: 39.8.8
ElectronBuildId: 13870025
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

Gitlens pre-release version

2026.5.130557

Note: Discovered while testing #5175

Metadata

Metadata

Assignees

Labels

area-graphIssues or features related to the Commit GraphtriageNeeds to be looked at

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions