Skip to content

Fix terminal lag + related warnings when dragging an active session to a new window - #14432

Merged
bholmesdev merged 5 commits into
masterfrom
oz-agent/implement-issue-14387
Jul 31, 2026
Merged

bholmesdev merged 5 commits into
masterfrom
oz-agent/implement-issue-14387

Conversation

@warp-for-oss

@warp-for-oss warp-for-oss Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14387

fix-keyboard-lag.mp4

Description

A terminal with an actively running process (ex. Claude Code) became laggy after you dragged its tab into a different window.

This is because the window_id could become stale after the session is moved to a new window. This removes the explicit prop on TaskCallback::ViewFromStream and looks up the window id at call time.

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).

Testing

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

Manual test: drag a tab that runs a Claude Code session into a new window. The terminal stays responsive, and the CPU load stays low.

Automated test: test_transfer_view_stream_continues_in_target_window sends stream items after a window transfer. It confirms that the target window receives each item and the completion callback.

Commands:

  • cargo nextest run -p warpui_core transfer_view
  • ./script/format
  • cargo clippy --workspace --exclude warp_completer --all-targets --tests -- -D warnings
  • cargo clippy -p warp --all-targets --tests -- -D warnings
  • cargo clippy -p warp_completer --all-targets --tests -- -D warnings

Screenshots / Videos

See the video above.

Agent Mode

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

CHANGELOG-BUG-FIX: Fixed a terminal that became laggy and used more CPU after you dragged its tab into a different window.

@warp-for-oss

warp-for-oss Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor Author

@bholmesdev

I'm starting a first review of this pull 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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Overview

This PR adds a discard cleanup path for pane groups, uses it when replacing transferred-tab placeholders, and adds regression coverage that discarded panes detach as permanently closed.

Concerns

  • The new regression test verifies the permanent detach mode, but it does not cover the terminal-specific PTY shutdown behavior that prevents the wakeup warning.

Verdict

Found: 0 critical, 0 important, 1 suggestions

Approve with nits

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

Powered by Oz

Comment thread app/src/pane_group/mod_tests.rs Resolved
@bholmesdev
bholmesdev requested a review from vorporeal July 29, 2026 15:31
@bholmesdev bholmesdev changed the title fix: close transferred tab placeholders permanently Fix terminal lag + related warnings when dragging an active session to a new window Jul 29, 2026
@bholmesdev
bholmesdev requested review from alokedesai and peicodes and removed request for alokedesai and vorporeal July 31, 2026 18:31
@bholmesdev
bholmesdev merged commit 80a4e46 into master Jul 31, 2026
46 checks passed
@bholmesdev
bholmesdev deleted the oz-agent/implement-issue-14387 branch July 31, 2026 19:30
zhangyu1818 pushed a commit to zhangyu1818/warply that referenced this pull request Aug 3, 2026
…ss-window transfer

Port of upstream warpdotdev#14432. A terminal running an active process became
laggy after dragging its tab into a new window because
TaskCallback::ViewFromStream captured the original window_id, which went
stale after the transfer. Removes the explicit window_id field and looks
up the current window from view_to_window at item-delivery and completion.

Adapted for edition 2021: completion branch uses nested if-let instead of
let-chains.
jwp2987 pushed a commit to jwp2987/phosphor that referenced this pull request Aug 16, 2026
…o a new window

Upstream 80a4e46 (warpdotdev#14432), closes upstream warpdotdev#14387. TaskCallback::ViewFromStream
carried the window_id captured at spawn time, so after a tab with a running
process was dragged into another window the relay kept resolving the *old*
window, found no view there, and errored on every stream item -- the terminal
went laggy and burned CPU. The prop is dropped and the view's current window is
looked up in view_to_window at call time, for both item delivery and completion.
transfer_view_to_window already maintains that map in this fork.

Cherry-picked with -x; both conflicts were against this fork's own divergence:
Zap keeps TUI views in the tui-gated window.tui_views map and dispatches to
whichever map holds the view, since dropping the TUI fallback silently kills the
relay task (and with it its stream, e.g. the PTY wakeup receiver). Resolved by
nesting the fork's GUI-then-TUI dispatch inside the new view_to_window lookup, so
the TUI path is now transfer-correct too rather than being left on the stale id.

No test was weakened: test_spawn_stream_local_from_view_await_after_closing_window
asserts only that the stream terminates, which it still does -- a closed window
drops its view_to_window entry, so the miss is now reported as "unable to retrieve
window" rather than "unable to retrieve view". Upstream's new
test_transfer_view_stream_continues_in_target_window applies unchanged.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VNUMjBVuwvEnRSgaawUCR3
TranscriptionFactory pushed a commit to TranscriptionFactory/warp that referenced this pull request Aug 30, 2026
…o a new window (warpdotdev#14432)

Closes warpdotdev#14387

https://github.com/user-attachments/assets/e5a4cbca-cab1-4b6d-b2c8-bc7a543c9917

A terminal with an actively running process (ex. Claude Code) became
laggy after you dragged its tab into a different window.

This is because the `window_id` could become stale after the session is
moved to a new window. This removes the explicit prop on
`TaskCallback::ViewFromStream` and looks up the window id at call time.

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

- [x] I have manually tested my changes locally with `./script/run`

Manual test: drag a tab that runs a Claude Code session into a new
window. The terminal stays responsive, and the CPU load stays low.

Automated test: `test_transfer_view_stream_continues_in_target_window`
sends stream items after a window transfer. It confirms that the target
window receives each item and the completion callback.

Commands:

- `cargo nextest run -p warpui_core transfer_view`
- `./script/format`
- `cargo clippy --workspace --exclude warp_completer --all-targets
--tests -- -D warnings`
- `cargo clippy -p warp --all-targets --tests -- -D warnings`
- `cargo clippy -p warp_completer --all-targets --tests -- -D warnings`

See the video above.

- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: Fixed a terminal that became laggy and used more CPU
after you dragged its tab into a different window.

---------

Co-authored-by: Oz <[email protected]>
Co-authored-by: Ben Holmes <[email protected]>
(cherry picked from commit 80a4e46)
NourEldinShobier pushed a commit to NourEldinShobier/MyWarp that referenced this pull request Nov 16, 2026
…o a new window (warpdotdev#14432)

Closes warpdotdev#14387

https://github.com/user-attachments/assets/e5a4cbca-cab1-4b6d-b2c8-bc7a543c9917

A terminal with an actively running process (ex. Claude Code) became
laggy after you dragged its tab into a different window.

This is because the `window_id` could become stale after the session is
moved to a new window. This removes the explicit prop on
`TaskCallback::ViewFromStream` and looks up the window id at call time.

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

- [x] I have manually tested my changes locally with `./script/run`

Manual test: drag a tab that runs a Claude Code session into a new
window. The terminal stays responsive, and the CPU load stays low.

Automated test: `test_transfer_view_stream_continues_in_target_window`
sends stream items after a window transfer. It confirms that the target
window receives each item and the completion callback.

Commands:

- `cargo nextest run -p warpui_core transfer_view`
- `./script/format`
- `cargo clippy --workspace --exclude warp_completer --all-targets
--tests -- -D warnings`
- `cargo clippy -p warp --all-targets --tests -- -D warnings`
- `cargo clippy -p warp_completer --all-targets --tests -- -D warnings`

See the video above.

CHANGELOG-BUG-FIX: Fixed a terminal that became laggy and used more CPU
after you dragged its tab into a different window.

Adapted for edition 2021: the upstream let chain in the on_done arm was rewritten as nested if let with identical semantics.
(cherry picked from commit 80a4e46)
(cherry picked from commit c9447b8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dragging a tab into a new window breaks its wakeup channel, causing input lag and elevated CPU

3 participants