Expose terminal focus URL env vars#11130
Conversation
|
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 @BobbyWang0120 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 |
|
This PR is not linked to an issue that is marked with Issue-state enforcement details:
To continue, link this PR to a same-repo issue such as Powered by Oz |
There was a problem hiding this comment.
This PR is not linked to an issue that is marked with ready-to-implement.
Issue-state enforcement details:
-
Associated same-repo issues checked: none
-
Required readiness label:
ready-to-implement
To continue, link this PR to a same-repo issue such as Closes #123 in the PR description, and make sure that issue has ready-to-implement.
Powered by Oz
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds per-terminal session focus environment variables and forwards them through the WSL allowlist so external tools can deep-link back to the originating pane.
Concerns
- This is user-facing terminal behavior, but the PR description says no screenshots or videos are attached. For this user-facing change, please include screenshots or a screen recording demonstrating the environment variables and focus URL working end to end.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
warp-focus-demo.mp4Added a short demo showing |
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR exposes per-terminal session focus environment variables and forwards them through the Windows WSL allowlist so external tools can deep-link back to the originating pane.
Concerns
- For this user-facing terminal behavior change, please include screenshots or a screen recording demonstrating it working end to end. The PR description says no media is attached; a short recording showing
WARP_FOCUS_URLfocusing the originating pane would satisfy this requirement.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
/oz-review |
|
I'm re-reviewing this pull request in response to a review request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: Comment Powered by Oz |
Oz no longer requests changes for this pull request after the latest automated review.
There was a problem hiding this comment.
Overview
This PR threads each terminal pane's persisted session UUID into local terminal creation so child processes receive WARP_TERMINAL_SESSION_UUID and a channel-aware WARP_FOCUS_URL, and it updates the WSL allowlist so those values pass through to WSL shells.
Concerns
- No blocking correctness or security concerns found in the changed lines.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
a09e754 to
369df62
Compare
Description
Expose a per-terminal focus handle to processes running inside Warp terminal sessions.
This adds two environment variables to terminal sessions:
WARP_TERMINAL_SESSION_UUID: the terminal session UUID as 32 lowercase hex characters.WARP_FOCUS_URL: a channel-aware deep link such aswarposs://session/<uuid>orwarp://session/<uuid>.External notifier scripts can use
WARP_FOCUS_URLas an opaque jump-back target. Opening that URL lets Warp resolve the current window, pane group, and pane internally via the existing session deep-link handler.The WSL allowlist is also updated so these values can pass through to WSL shells.
Linked Issue
ready-to-specorready-to-implement.Closes #8611
Testing
I have manually tested my changes locally with
./script/runrustfmt --edition 2021 --check app/src/terminal/focus_env.rs app/src/terminal/mod.rs app/src/pane_group/mod.rs app/src/terminal/local_tty/windows/environment.rsgit diff --check -- app/src/pane_group/mod.rs app/src/terminal/local_tty/windows/environment.rs app/src/terminal/mod.rs app/src/terminal/focus_env.rscargo test -p warp terminal::focus_env::tests::focus_env_vars_point_at_session_deeplink --libManual: launched local
WarpOss, confirmedWARP_TERMINAL_SESSION_UUIDandWARP_FOCUS_URLare present in terminal panes, and verifiedopen "$WARP_FOCUS_URL"focuses the originating pane across multiple panes/windows.Screenshots / Videos
Demo video: https://github.com/user-attachments/assets/0aba8e7e-e5d6-4449-a371-296c862f893d
The recording shows
WARP_TERMINAL_SESSION_UUIDandWARP_FOCUS_URLin a localWarpOsspane, then uses the focus URL from another terminal to return focus to the originating pane.Agent Mode
CHANGELOG-IMPROVEMENT: Expose a Warp focus URL in terminal session environments so external notification tools can return focus to the originating pane.