feat(terminal): publish session focus-URL env vars on spawn - #80
Merged
Conversation
Ports Warp's session focus-URL producer. The app already handles the consumer side of the `<scheme>://session/<uuid-hex>` deeplink (crate::uri's `UriHost::Session` → `PaneGroup::find_terminal_pane_by_session_uuid`), but nothing published that URL into the terminal's environment — so a process inside a session had no way to deep-link back to its own pane (e.g. to focus it when a long-running command finishes). Add `app/src/terminal/focus_env.rs` (`WARP_FOCUS_URL` + `WARP_TERMINAL_SESSION_UUID`, `session_focus_url`, `add_session_focus_env_vars`) and call it from `PaneGroup::create_session` — the single session-creation choke point. Each of the five callers now threads the same UUID it builds the pane with, so the published deeplink resolves back to that pane. `initial_single_terminal_pane` minted its UUID after `create_session`; moved it above the call so the env var and the pane share one UUID. Env-var names keep the `WARP_` prefix the fork uses for its other shell-integration vars; the URL uses the fork's own `ChannelState::url_scheme`. Ports Warp's `focus_env_tests.rs`. app builds clean; the ported test passes. Part of #2 / the #11 feature-parity ledger (deep-link focus-URL env plumbing). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012gDYSHa4oDvQbfungWwG1h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #2 / the #11 feature-parity ledger ("deep-link focus-URL env plumbing").
What
The app already handles the consumer side of the
<scheme>://session/<uuid-hex>deeplink (crate::uri'sUriHost::Session→PaneGroup::find_terminal_pane_by_session_uuid), but nothing published that URL into the terminal's environment — so a process inside a session couldn't deep-link back to its own pane (e.g. to focus it when a long-running command finishes).How
app/src/terminal/focus_env.rs:WARP_FOCUS_URL+WARP_TERMINAL_SESSION_UUID,session_focus_url,add_session_focus_env_vars(ported from Warp).PaneGroup::create_session— the single session-creation choke point.create_sessionnow takessession_uuid: &[u8]; each of the 5 callers threads the same UUID it builds the pane with, so the published deeplink resolves back to that pane.initial_single_terminal_paneminted its UUID aftercreate_session; moved it above the call so the env var and the pane share one UUID.WARP_prefix the fork uses for its other shell-integration vars; the URL uses the fork's ownChannelState::url_scheme.Ports Warp's
focus_env_tests.rs. App builds clean; the ported test passes.🤖 Generated with Claude Code