Microsoft/vscode
View on GitHubExpose command and context key to close Dirty Diff inline view
Open
#265,297 opened on Sep 5, 2025
feature-requesthelp wantedscm
Repository metrics
- Stars
- (74,848 stars)
- PR merge metrics
- (Avg merge 11h 43m) (1,000 merged PRs in 30d)
Description
Currently, the "Dirty Diff" inline view (the zone widget that appears when using "Show Previous Change" on a modified line gutter) can only be closed by clicking the small "x" button with the mouse.
Problem:
- The Dirty Diff widget is not focusable from the editor using the keyboard (arrow keys or tab do not reach it).
- There is no public command exposed to close it (
closeDirtyDiffis not available in the command registry). - As a result, it's impossible to bind a keyboard shortcut (e.g. Escape) to close this view.
Expected / Feature request:
- Expose a command like
git.closeDirtyDiff. - Provide a
whencontext key (e.g.dirtyDiffVisible) that evaluates totruewhen the Dirty Diff widget is open.
Benefits:
- Keyboard users (or users with accessibility needs) would be able to close the Dirty Diff without touching the mouse.
- Consistency with Peek editors, which already support both a command and a context key for closing.
Steps to reproduce current limitation:
- Open a file with uncommitted changes.
- Click in the gutter and choose "Show Previous Change".
- The Dirty Diff widget appears.
- Press Escape → nothing happens, the widget remains open.
- No command exists in the Command Palette or
keybindings.json(to my knowledge ) to close it.
This makes it impossible to close the widget using only the keyboard.
Config
Version: 1.103.2
Commit: 6f17636121051a53c88d3e605c491d22af2ba755
Date: 2025-08-20T16:45:34.255Z
Electron: 37.2.3
ElectronBuildId: 12035395
Chromium: 138.0.7204.100
Node.js: 22.17.0
V8: 13.8.500258-electron.0
OS: Darwin arm64 24.6.0