Agents - disable git commands in the editor title#311645
Merged
Conversation
sandy081
approved these changes
Apr 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the built-in Git extension’s editor/title menu contributions to hide several Git actions when running in the Agents “Sessions” window (isSessionsWindow), reducing editor title actions that aren’t intended to be available there.
Changes:
- Add
!isSessionsWindowto thewhenclauses forgit.openChangein the editor title. - Add
!isSessionsWindowto thewhenclauses for several stage/unstage/revert range commands shown in the editor title (including diff-editor variants).
Show a summary per file
| File | Description |
|---|---|
| extensions/git/package.json | Adds !isSessionsWindow guards to multiple Git editor/title menu items so they don’t show in Sessions windows. |
Copilot's findings
Comments suppressed due to low confidence (1)
extensions/git/package.json:2779
- The PR title suggests disabling git commands in the editor title for Sessions windows, but this change only adds
!isSessionsWindowto a subset of theeditor/titlemenu items (openChange/stage/unstage/etc). Othereditor/titleitems in this same block (e.g.git.openFile,git.stashApplyEditor/git.stashDropEditor) still lack the Sessions-window guard, so they may continue to appear in Sessions windows. Consider either adding&& !isSessionsWindowconsistently to alleditor/titlegit menu contributions, or adjusting the scope/title to reflect that only some commands are being hidden.
{
"command": "git.openChange",
"group": "navigation@2",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0 && !isInDiffEditor && !isMergeEditor && resourceScheme == file && scmActiveResourceHasChanges && !isSessionsWindow"
},
{
"command": "git.stashApplyEditor",
"alt": "git.stashPopEditor",
"group": "navigation@1",
"when": "config.git.enabled && !git.missing && resourceScheme == git-stash"
- Files reviewed: 1/1 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.