microsoft / microsoft/vscode

Source Control: "Reveal in File Explorer" is shown for deleted files but silently does nothing

Open
#332,749 0 comments 0 reactions 1 assignee Claimed by @lszomoru View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Does this issue occur when all extensions are disabled?

Yes

## Steps to Reproduce

1. Open a git repository in VS Code
2. Delete a tracked file (don't stage the deletion)
3. Open the Source Control view — the file appears under Changes with status "Deleted"
4. Right-click the file → "Reveal in File Explorer" (Windows) / "Reveal in Finder" (macOS) / "Open Containing Folder" (Linux)

## Expected

Either the menu entry is hidden for deleted resources, or clicking it gives some feedback.

## Actual

The menu entry is shown and clickable, but clicking it does nothing observable — no Explorer/Finder window opens, no error, no message. The command silently no-ops because the underlying `shell.showItemInFolder` does nothing when the target path doesn't exist, and neither `git.revealFileInOS` nor `git.revealInExplorer` (in `extensions/git/src/commands.ts`) check whether the resource still exists before invoking it.

I have a fix ready (guard both commands the same way `git.openFile` already guards against deleted resources, and show a warning instead of failing silently) — will open a PR referencing this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.