You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Add "copy file path" action to diff review and file viewer #34823
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Summary
Add an action to copy the file name, path, or relative path directly from the git diff review and file viewer panels of the new UI.
Motivation
Right now, when reviewing a diff or browsing a file, there's no quick way to grab the file's path. Users have to manually locate the file in a file explorer or reconstruct the path by hand, which slows down workflows like:
Referencing a file in a commit message, PR description, or Slack/chat message.
Pasting a path into a terminal command (cat, code, git blame, etc.).
Sharing a file location with a teammate or an AI assistant.
Proposed behavior
Add a copy action in both:
Diff review view: right-click context menu on the file name
File viewer: right-click context menu on the file tab.
The action should offer at least one of the following formats:
File name only — e.g. Component.tsx
Relative path — e.g. src/components/Component.tsx
Full/absolute path — e.g. /home/user/project/src/components/Component.tsx
Nice to have
Keyboard shortcut to copy the relative path of the currently focused file.
Visual confirmation (toast/tooltip) when the path is copied, e.g. "Copied to clipboard".
Willingness to contribute
Happy to submit a PR for this if there's consensus on the approach / a maintainer gives the go-ahead on the general direction.
If your request specifically targets the diff review and file viewer panels (rather than the file tree), it may still be distinct enough to keep open — please clarify in the issue or cross-reference these.
I consider this request is not a duplicate of any of the mentioned by copilot as those focus on the file explorer / file tree view. Although, all of these are complementary and could probably be addressed together with a common solution.
When working with the file tree in the workspace sidebar, I frequently need to operate on the currently selected file/directory. Right now, I have to manually type paths or drag files around, which is slow and error-prone. I'd like a right-click context menu on file tree items that provides quick actions:
Copy Relative Path — copy the path relative to the current workspace root (e.g. src/components/Button.tsx) to the clipboard.
Copy Absolute Path — copy the full absolute path (e.g. D:\projects\my-app\src\components\Button.tsx) to the clipboard.
Reveal in File Explorer — open the system file explorer (Windows Explorer / Finder / Nautilus) and highlight the selected file or directory.
Reference File — insert a file reference (e.g. @src/components/Button.tsx or the file:path syntax used for attachments) directly into the active chat input, so I can easily attach files without dragging them.
These actions are standard in other editors (VS Code, Zed, etc.) and would significantly speed up workflows like referencing files in prompts, sharing paths, and locating files on disk. Multiple selection support (e.g. copying a list of paths when several files are selected) would be a nice bonus.
Activity
github-actions commentedon Jul 2, 2026
This issue might be a duplicate of existing issues. Please check:
If your request specifically targets the diff review and file viewer panels (rather than the file tree), it may still be distinct enough to keep open — please clarify in the issue or cross-reference these.
agustinzamar commentedon Jul 2, 2026
I consider this request is not a duplicate of any of the mentioned by copilot as those focus on the file explorer / file tree view. Although, all of these are complementary and could probably be addressed together with a common solution.
xingxiulaomo commentedon Jul 20, 2026
👍 +1 This would be very helpful for quickly sharing file paths.
StarryJinda commentedon Aug 14, 2026
When working with the file tree in the workspace sidebar, I frequently need to operate on the currently selected file/directory. Right now, I have to manually type paths or drag files around, which is slow and error-prone. I'd like a right-click context menu on file tree items that provides quick actions:
Copy Relative Path — copy the path relative to the current workspace root (e.g. src/components/Button.tsx) to the clipboard.
Copy Absolute Path — copy the full absolute path (e.g. D:\projects\my-app\src\components\Button.tsx) to the clipboard.
Reveal in File Explorer — open the system file explorer (Windows Explorer / Finder / Nautilus) and highlight the selected file or directory.
Reference File — insert a file reference (e.g. @src/components/Button.tsx or the file:path syntax used for attachments) directly into the active chat input, so I can easily attach files without dragging them.
These actions are standard in other editors (VS Code, Zed, etc.) and would significantly speed up workflows like referencing files in prompts, sharing paths, and locating files on disk. Multiple selection support (e.g. copying a list of paths when several files are selected) would be a nice bonus.
github-actions commentedon Oct 15, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.