Skip to content

open_file_editor deep link cannot target a tab other than the active one #16695

Open

Description

@pete-the-pete

Pre-submit Checks

Describe the solution you'd like?

warp://action/open_file_editor opens the file in whichever tab is active when Warp handles the URI. If I switch tabs after requesting the panel and before it opens, the file opens in the wrong tab. I want it to open in the tab that originated the request: the tab containing the terminal session whose shell ran the command.

Add an optional session query parameter so the caller can name that tab:

warp://action/open_file_editor?path=/abs/path/file.md&session=<session-uuid-hex>

Proposed behavior:

  • The file opens in the tab that contains the terminal session with that UUID. The existing code.editor.open_file_layout setting (split pane or new tab) applies relative to that tab.
  • Warp does not switch the active tab. The panel opens in the target tab in the background.
  • If no pane matches the UUID (for example, the tab was closed), Warp logs a warning and does nothing. It does not fall back to the active tab.
  • Without session, behavior is unchanged.

The scope is open_file_editor only. Other warp://action/* handlers could adopt the same parameter later.

Is your feature request related to a problem? Please describe.

When using tools launched from a shell (coding agents, scripts, CLIs), I often want to show a file in a panel next to the terminal that ran the command. I have a script that does this today through open_file_editor.

  • Current: the panel opens in whichever tab is active when Warp handles the URI, not when the command was run. open_file_editor has no way to target any other tab.
  • Problem: if I switch tabs between requesting the panel and Warp opening it, the panel opens in the wrong tab, next to unrelated work. The originating tab never gets it.
  • Wanted: the panel opens in the tab that originated the request, even if I have switched away in the meantime. The panel placement itself (a split pane to the right, per code.editor.open_file_layout) stays as it is today.

Additional context

Current behavior, from reading the code:

  • app/src/uri/mod.rs (open_file_editor) resolves a window and calls Workspace::open_file_with_target.
  • app/src/workspace/view.rs (open_file_with_target, open_file_notebook) places the pane through active_tab_pane_group(), so placement is always relative to the active tab.

Existing pieces that make this small:

  • Every Warp shell exports WARP_TERMINAL_SESSION_UUID (and WARP_FOCUS_URL=warp://session/<uuid>), defined in crates/warp_terminal/src/focus_env.rs. A caller can pass that value as session with no new identifier.
  • The warp://session/<uuid> handler in app/src/uri/mod.rs already resolves a UUID to a window, pane group, and pane with find_terminal_pane_by_session_uuid. It only focuses the pane; it does not open content.

Related: #8929 asks to focus an existing tab by name or path. This request is about opening content in a tab that is not active, and does not overlap with focusing.

Caller note: with no fallback, a stale UUID means the file silently does not open. If maintainers prefer falling back to the active tab, that works for my use case too.

Operating system (OS)

Cross-platform

How important is this feature to you?

3

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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