Skip to content

Report focus events for normal-screen terminal apps#11946

Merged
zachbai merged 1 commit into
warpdotdev:masterfrom
BobbyWang0120:bobby/focus-reporting-normal-screen
Jun 5, 2026
Merged

Report focus events for normal-screen terminal apps#11946
zachbai merged 1 commit into
warpdotdev:masterfrom
BobbyWang0120:bobby/focus-reporting-normal-screen

Conversation

@BobbyWang0120
Copy link
Copy Markdown
Contributor

@BobbyWang0120 BobbyWang0120 commented May 30, 2026

Description

Fixes normal-screen DECSET 1004 focus reporting. Warp already parsed ESC[?1004h and emitted focus events for alt-screen apps, but the focus-reporting gate required model.is_alt_screen_active(). Normal-screen foreground apps that enable focus reporting, such as a long-running CLI TUI/probe, never received ESC[O on blur or ESC[I on focus.

This changes the gate to use the active terminal mode via model.is_term_mode_set(TermMode::FOCUS_IN_OUT), so focus events are emitted for whichever screen/mode currently owns the foreground process.

Linked Issue

Fixes #11945

Testing

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

Manual:

  • Ran a normal-screen DECSET 1004 probe in a local Warp build and confirmed switching away/back prints FOCUS_OUT then FOCUS_IN.

Automated:

  • cargo test -p warp focus_reporting_writes_focus_events_in_normal_screen
  • cargo check -p warp --lib
  • cargo fmt --package warp --check
  • git diff --check
  • cargo clippy -p warp --lib -- -D warnings

Screenshots / Videos

https://github.com/BobbyWang0120/warp/releases/download/focus-reporting-demo-assets/warp-focus-reporting-demo.mp4

Demo: a normal-screen DECSET 1004 probe receives FOCUS_OUT after Warp loses focus and FOCUS_IN after Warp regains focus.

Agent Mode

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

Co-Authored-By: Warp agent@warp.dev

Co-Authored-By: Warp <agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 30, 2026
@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 30, 2026
@BobbyWang0120
Copy link
Copy Markdown
Contributor Author

warp-focus-reporting-demo.mp4

@BobbyWang0120
Copy link
Copy Markdown
Contributor Author

Maintainers: could someone please add the ready-to-implement label to the linked issue #11945 when you have a moment? I don’t have permission to apply labels on upstream issues, and Warp’s PR checklist asks for the linked issue to be marked ready-to-spec or ready-to-implement so review can move forward. Thank you!

@BobbyWang0120 BobbyWang0120 marked this pull request as ready for review May 30, 2026 22:19
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 30, 2026

@BobbyWang0120

This PR is not linked to an issue that is marked with ready-to-implement.

Issue-state enforcement details:

Readiness check:

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-for-oss[bot]
oz-for-oss Bot previously requested changes May 30, 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: #11945

  • Required readiness label: ready-to-implement

Readiness check:

  • #11945: missing ready-to-implement; readiness labels present: none

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
Contributor Author

Thanks for marking #11945 ready-to-implement! I believe the linked-issue requirement for this PR is now satisfied.

Could someone re-run the Oz review / issue-state check or dismiss the stale “changes requested” review from before the label was added?

@BobbyWang0120
Copy link
Copy Markdown
Contributor Author

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Jun 2, 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 oz-for-oss Bot dismissed their stale review June 2, 2026 17:17

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 updates terminal focus reporting so DECSET 1004 events are gated by the active terminal mode rather than only alt-screen state, and adds a regression test for normal-screen focus events.

Concerns

  • No blocking concerns found. Visual evidence is included in the PR description, and no approved spec context was provided for additional implementation checks.

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

@kevinchevalier kevinchevalier requested a review from zachbai June 3, 2026 19:25
vkodithala added a commit to warpdotdev/oz-for-oss that referenced this pull request Jun 4, 2026
…es (#472)

## What
Strip `<...>` segments from each `**Owners**:` bullet value in `warp-ownership/ownership-areas/*.md` before extracting `@handles`, so emails like `<name@warp.dev>` no longer contribute a bogus `warp` owner.

## Why
The ownership-area bullets use the form `@handle <email@warp.dev>`. The previous owner-handle regex was unanchored, so it greedily picked up `@warp` from the email domain in addition to the real handle. `_resolve_reviewer_from_ownership_area` then random-picked uniformly across the polluted owner list. When the choice landed on `warp` (or another email-domain match), `pr.create_review_request(reviewers=[\"warp\"])` 422s on GitHub (\"Reviews may only be requested from collaborators\") and the workflow silently degraded to \"no human review was requested\" — leaving non-member approved PRs without an assigned reviewer.

Real-world example: PR [warpdotdev/warp#11946](warpdotdev/warp#11946) (`recommended_area: \"Shell Compatibility\"`).

## How
- `oz/ownership.py`: added an `_ANGLE_SEGMENT_RE` substitution that strips `<...>` segments before `_OWNER_HANDLE_RE.finditer`. Same dedup/order behavior; just no longer counts email domains as handles.
- `tests/test_ownership.py`: one regression test (`test_ignores_handles_inside_angle_bracketed_emails`) using the real `@handle <email@warp.dev>` shape.

## Verification
`python -m unittest tests.test_ownership` → 16/16 pass, including the new test.

Generated with [Oz](https://staging.warp.dev/conversation/3843f759-01a1-43a5-ae12-65f04335d59d).
@BobbyWang0120
Copy link
Copy Markdown
Contributor Author

@zachbai quick update: this PR should be ready for review now. The linked issue has the needed readiness label, the PR checklist is updated, and the latest Oz review did not call out anything else to address. I think we’re just waiting for the reviewer-triggered review pipeline at this point. Thanks!

Copy link
Copy Markdown
Contributor

@zachbai zachbai left a comment

Choose a reason for hiding this comment

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

Thanks for the change!

@BobbyWang0120
Copy link
Copy Markdown
Contributor Author

@zachbai thanks again for reviewing and approving this! All checks are passing now and the PR looks clean/mergeable from my side. Whenever you have a chance, could you please help merge it or route it to whoever should do the final merge? Really appreciate it.

@zachbai zachbai merged commit 370b671 into warpdotdev:master Jun 5, 2026
57 checks passed
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.

Focus reporting mode does not emit events for normal-screen apps

2 participants