Skip to content

Add "Copy current path" command palette action#13148

Open
elviskahoro wants to merge 1 commit into
warpdotdev:masterfrom
elviskahoro:conductor/copy-file-path-palette
Open

Add "Copy current path" command palette action#13148
elviskahoro wants to merge 1 commit into
warpdotdev:masterfrom
elviskahoro:conductor/copy-file-path-palette

Conversation

@elviskahoro

@elviskahoro elviskahoro commented Jun 28, 2026

Copy link
Copy Markdown

Closes #13149. Extends #13145 — adds the command-palette half of #8974.

What

Adds a "Copy current path" entry to the command palette that copies a path based on the focused pane, so the path can be copied without right-clicking and whether or not the file viewer is open:

  • File viewer focused (FilePaneFileNotebookView) → copies the open file's display_path() (works for local and remote/SSH).
  • Terminal / block focused → copies the current session's working directory (pwd).

This complements the right-click "Copy file path" item added to the file viewer in #13145.

How

  • app/src/workspace/action.rs — new WorkspaceAction::CopyCurrentPath (added to the should_save_app_state_on_action => false list, since copying a path doesn't mutate app state).
  • app/src/pane_group/mod.rsPaneGroup::path_from_focused_pane, mirroring the existing selected_text_from_focused_pane sibling. Resolves a focused FilePane → file display_path(), otherwise focused_session_view().pwd() (falling back to display_working_directory, matching the existing tab "Copy working directory" item). Placed here so no local_fs cfg-gating is needed (FilePane is unconditionally available in this module).
  • app/src/workspace/mod.rs — registers the always-available workspace:copy_current_path binding (palette label "Copy current path", id!("Workspace") predicate). No-op when nothing resolves.
  • app/src/workspace/view.rsWorkspace::handle_action arm that writes the resolved path to the clipboard.
  • crates/integration/... — integration test test_copy_current_path_copies_terminal_pwd (cd into a known dir, run the palette action, assert the clipboard equals the focused terminal's pwd), registered in the three usual places.

Scope: the rendered file viewer (FilePane) is covered; the code editor pane (CodePane) is intentionally out of scope.

Testing

  • cargo check -p warp --lib → passes, no new warnings.
  • cargo check -p integration --all-targets → passes (new test compiles and is registered).
  • rustfmt --check on all touched files → clean.
  • The integration test compiles and is wired up but was not executed here — Warp's UI integration tests need a real display. The file-viewer branch isn't exercised end-to-end, but it shares the same dispatch path as the tested terminal case and reuses the path() / display_path() accessors already unit-tested in Add "Copy file path" to file viewer pane right-click menu #13145.

Adds a "Copy current path" entry to the command palette that copies a
path based on the focused pane: the open file's display path when the
rendered file viewer (FilePane) is focused, otherwise the current
session's working directory when a terminal/block is focused. Works
whether or not the file viewer is open.

Extends the file-viewer right-click "Copy file path" item (warpdotdev#13145 /
warpdotdev#8974) to the command palette.

- New WorkspaceAction::CopyCurrentPath (no-op when no path resolves),
  registered as an always-available "Copy current path" binding.
- PaneGroup::path_from_focused_pane resolves the path, mirroring the
  existing selected_text_from_focused_pane sibling.
- Integration test covering the terminal-pwd case.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cla-bot

cla-bot Bot commented Jun 28, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @elviskahoro on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@oz-for-oss

oz-for-oss Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

@elviskahoro

Every PR must be linked to a same-repo issue before Oz can review it.

Next step: open or find a same-repo issue describing this change, then link it to this PR by adding Closes #123 to the PR description (or using the "Development" sidebar on GitHub). A maintainer will mark the issue ready-to-implement when it is ready. Once it is marked, comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Jun 28, 2026

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elviskahoro

Every PR must be linked to a same-repo issue before Oz can review it.

Next step: open or find a same-repo issue describing this change, then link it to this PR by adding Closes #123 to the PR description (or using the "Development" sidebar on GitHub). A maintainer will mark the issue ready-to-implement when it is ready. Once it is marked, comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

@elviskahoro

Copy link
Copy Markdown
Author

@oz-agent This PR closes #13143

@elviskahoro

Copy link
Copy Markdown
Author

@bholmesdev I did the CLA check! lmk if this needs feature flag

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

Labels

external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: "Copy current path" command-palette action

1 participant