Skip to content

[FEATURE]: Add "copy file path" action to diff review and file viewer #34823

Closed as not planned

Description

@agustinzamar

Feature hasn't been suggested before.

  • 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:

  1. Diff review view: right-click context menu on the file name
  2. 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.

Activity

  1. github-actions commented on Jul 2, 2026

    @github-actions
    Contributor

    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.

  2. agustinzamar commented on Jul 2, 2026

    @agustinzamar
    Author

    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.

  3. xingxiulaomo commented on Jul 20, 2026

    @xingxiulaomo

    👍 +1 This would be very helpful for quickly sharing file paths.

  4. StarryJinda commented on Aug 14, 2026

    @StarryJinda

    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.

  5. github-actions commented on Oct 15, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions