Skip to content

Expose terminal focus URL env vars#11130

Open
BobbyWang0120 wants to merge 1 commit into
warpdotdev:masterfrom
BobbyWang0120:feature/external-notifier-focus-url
Open

Expose terminal focus URL env vars#11130
BobbyWang0120 wants to merge 1 commit into
warpdotdev:masterfrom
BobbyWang0120:feature/external-notifier-focus-url

Conversation

@BobbyWang0120
Copy link
Copy Markdown

@BobbyWang0120 BobbyWang0120 commented May 17, 2026

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 as warposs://session/<uuid> or warp://session/<uuid>.

External notifier scripts can use WARP_FOCUS_URL as 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

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Closes #8611

Testing

  • I have manually tested my changes locally with ./script/run

  • rustfmt --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.rs

  • git 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.rs

  • cargo test -p warp terminal::focus_env::tests::focus_env_vars_point_at_session_deeplink --lib

  • Manual: launched local WarpOss, confirmed WARP_TERMINAL_SESSION_UUID and WARP_FOCUS_URL are present in terminal panes, and verified open "$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_UUID and WARP_FOCUS_URL in a local WarpOss pane, then uses the focus URL from another terminal to return focus to the originating pane.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-IMPROVEMENT: Expose a Warp focus URL in terminal session environments so external notification tools can return focus to the originating pane.

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 17, 2026

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 @cla-bot check to trigger another check.

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 17, 2026

@BobbyWang0120

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

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 17, 2026
oz-for-oss[bot]
oz-for-oss Bot previously requested changes May 17, 2026
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

@BobbyWang0120

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

@BobbyWang0120
Copy link
Copy Markdown
Author

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 17, 2026

@BobbyWang0120

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

oz-for-oss[bot]
oz-for-oss Bot previously requested changes May 17, 2026
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

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

@BobbyWang0120
Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label May 17, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 17, 2026

The cla-bot has been summoned, and re-checked this pull request!

@BobbyWang0120
Copy link
Copy Markdown
Author

warp-focus-demo.mp4

Added a short demo showing WARP_TERMINAL_SESSION_UUID and WARP_FOCUS_URL in a WarpOss pane, then using the focus URL from another terminal to jump back to that pane.

@BobbyWang0120
Copy link
Copy Markdown
Author

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 17, 2026

@BobbyWang0120

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

oz-for-oss[bot]
oz-for-oss Bot previously requested changes May 17, 2026
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

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_URL focusing 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

@BobbyWang0120
Copy link
Copy Markdown
Author

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 17, 2026

@BobbyWang0120

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: @vkodithala.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot dismissed stale reviews from themself May 17, 2026 07:37

Oz no longer requests changes for this pull request after the latest automated review.

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

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

@BobbyWang0120 BobbyWang0120 force-pushed the feature/external-notifier-focus-url branch from a09e754 to 369df62 Compare May 17, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed 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.

Session ID Environment Variable and Deep Link Support

1 participant