Skip to content

fix(web): terminal tells the shell its new width as soon as you release a resize drag - #19395

Merged
t3dotgg merged 1 commit into
mainfrom
t3/fix-12058
Oct 14, 2026
Merged

t3dotgg merged 1 commit into
mainfrom
t3/fix-12058

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

After you drag the right-panel terminal divider, the terminal grid reflows at once, but the shell only learns the new width 150ms later. Typing in that window goes to a shell that still lays out the old width, and the caret can land inside the prompt (#12058).

The Ghostty surface now listens for pointer release on window. If a PTY resize is still waiting on the debounce, it fits once and sends the size right away. The debounce stays in place during the drag, so the prompt does not reprint on every pixel. This covers the panel divider, drawer height, split panes, and sidebar drags. Clicks with no pending resize do nothing. OS window resizes stay on the debounce.

Proof

  • New surface.test.ts case: shrink the mount mid-drag, then release at a final width. It fails on main (no onResize at release) and passes with this fix (one call with the final grid, no repeat from the observer).
  • Headless Chromium with the real surface and a real bash PTY, narrowing and widening drags:
    • main sends the final size about 152ms after release.
    • This branch sends it 1–3ms after release, exactly once.
  • Fuzzed drags plus typing on bash 5.2 and 5.3 (40–150ms simulated latency): no caret errors on either branch. I could not reproduce the exact caret-in-prompt frame from the issue recording on main in this setup, so this PR removes the 150ms gap the triage identified. It is not proven against that exact recording.
  • surface.test.ts and ThreadTerminalDrawer.permissions.test.tsx pass (76 tests). Web typecheck, lint, and format are clean.

Refs #12058

Reviewed with sol-loop: 1 round with GPT-6.1 Sol.

Model and harness: Claude Opus 5.5 in Claude Code via T3 Code.

🤖 Generated with Claude Code

The surface sent PTY resizes 150ms after the last layout change, so a
shell kept the old width briefly after the user released a panel,
drawer, or split divider. Flush the pending size on pointer release.

Fixes #12058

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 14, 2026
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 14, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 59685ef

Macroscope's review found this PR approvable — This is a narrowly scoped terminal resize bug fix that flushes the final PTY dimensions on pointer release while preserving debounced updates during dragging. The production change is isolated to the terminal surface and includes a focused regression test, with no defaults, schema, infrastructure, or static-analysis configuration changes.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 76088eef-6473-4082-a55a-6e32ea3fbdcb
📥 Commits

Reviewing files that changed from the base of the PR and between f99b202 and 59685ef.

📒 Files selected for processing: 2
  • apps/web/src/terminal/ghostty/surface.test.ts
  • apps/web/src/terminal/ghostty/surface.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

📝 Walkthrough

Changes

Terminal resize settling

Layer / File(s) Summary
Settle pending resize on pointer release
apps/web/src/terminal/ghostty/surface.ts, apps/web/src/terminal/ghostty/surface.test.ts
The surface listens for window pointerup and pointercancel events. If a resize is pending, it refits, cancels the debounce, and reports the current grid dimensions. The test verifies that release reports the settled dimensions once and that later updates do not trigger another callback.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: shivamhwp, stienswout

Merge Risk: ⚪ Minimal · up to 59685

No actionable merge-blocking risk is identified for the terminal resize change.

Pre-merge checks: Passed 4
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Issue [#12058] requires the right-panel terminal to recompute its grid, report new PTY dimensions, and reflow after a resize. surface.ts now handles window-level pointerup and pointercancel even…
Out of Scope Changes check Passed The changes are limited to terminal resize-release handling and its regression test. Window-level release handling supports the same drag-resize behavior for the panel, drawer, split panes, and sideba…
Title check Passed The title clearly and concisely describes the primary fix: sending the terminal's new width immediately after a resize drag ends.
Description check Passed The description covers the problem, implementation, scope, linked issue, limitations, focused verification, test results, and tooling. It is mostly complete, although it does not include explicit main…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@t3dotgg
t3dotgg merged commit 2cde3f7 into main Oct 14, 2026
34 checks passed
@t3dotgg
t3dotgg deleted the t3/fix-12058 branch October 14, 2026 11:34
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 14, 2026
## What's Changed
* fix(clients): # suggestions include pull requests linked to the thread by @t3dotgg in pingdotgg/t3code#19357
* fix(clients): pairing a switched-off computer again turns it back on by @t3dotgg in pingdotgg/t3code#19354
* fix(cli): t3 triage reports the server's version, not its own, as the user's build by @t3dotgg in pingdotgg/t3code#19359
* fix(client-runtime): a new WSL backend no longer shows Limited permissions until reload by @t3dotgg in pingdotgg/t3code#19361
* fix(web): action shortcuts recorded in the browser now save by @t3dotgg in pingdotgg/t3code#19365
* fix(clients): large pasted images no longer break later Claude image reads by @t3dotgg in pingdotgg/t3code#19364
* fix(server): settled and idle-released threads no longer stay Waiting by @t3dotgg in pingdotgg/t3code#19355
* perf(client-runtime): merged pull requests are no longer re-read every minute by @t3dotgg in pingdotgg/t3code#19374
* fix(server): new Codex threads no longer miss slow MCP servers' tools by @t3dotgg in pingdotgg/t3code#19368
* fix(github): requested teams now show in pull request reviewers by @t3dotgg in pingdotgg/t3code#19375
* fix(ssh): SSH launch no longer picks a port another server answers on by @t3dotgg in pingdotgg/t3code#19372
* fix(server): a failed T3 Connect relink no longer leaves a stale managed tunnel by @t3dotgg in pingdotgg/t3code#19383
* fix(shared): Windows .cmd shims no longer print DEP0190 on every spawn by @t3dotgg in pingdotgg/t3code#19385
* fix(server): commit and title generation use your custom model when no text model is set by @t3dotgg in pingdotgg/t3code#19386
* fix(web): T3 Connect settings can repair a link that drifted to publish-only by @t3dotgg in pingdotgg/t3code#19389
* fix(server): failed Claude text generation shows the CLI's own error by @t3dotgg in pingdotgg/t3code#19394
* fix(web): terminal tells the shell its new width as soon as you release a resize drag by @t3dotgg in pingdotgg/t3code#19395
* fix(web): keybindings page says to connect an environment when none is connected by @t3dotgg in pingdotgg/t3code#19400
* fix(chat): Codex follow-up suggestions show their label instead of raw markup by @t3dotgg in pingdotgg/t3code#19401
* fix(server): open in editor works over Tailscale SSH without a local sshd by @t3dotgg in pingdotgg/t3code#19402
* fix(server): a deregistered T3 Connect host shows it was removed and offers a relink by @t3dotgg in pingdotgg/t3code#19379
* perf(server): idle servers no longer scan every process every 5 seconds by @t3dotgg in pingdotgg/t3code#19399
* chore(typecheck): bump tsc-rs to 0.7.0 by @t3dotgg in pingdotgg/t3code#19408
* fix(server): bound Bitbucket API requests with 30s timeout by @kvnloo in pingdotgg/t3code#14140
* fix(server): new worktrees no longer fail when a background fetch runs at the same time by @t3dotgg in pingdotgg/t3code#19411
* perf(server): thread search runs on the SQLite reader worker by @bompus in pingdotgg/t3code#19382
* perf(server): traces keep ~40% more history and no longer block the event loop by @t3dotgg in pingdotgg/t3code#19430
* fix(shared): SQLite checkpoints no longer fall back to the main thread silently by @t3dotgg in pingdotgg/t3code#19417
* perf(server): unchanged node updates no longer write to SQLite by @t3dotgg in pingdotgg/t3code#19429
* fix(ssh): reconnecting keeps the remote server and its agents running by @t3dotgg in pingdotgg/t3code#19432
* feat(observability): SQL spans show lock wait and connection; stalls keep their own history by @t3dotgg in pingdotgg/t3code#19425
* fix(server): threads woken by notifications no longer load their whole history by @t3dotgg in pingdotgg/t3code#19423
* fix(server): worktree cleanup no longer runs sweeps back to back by @t3dotgg in pingdotgg/t3code#19418


**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261014.3105...v0.0.46-nightly.20261014.3118

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261014.3118
github-actions Bot added a commit to davidvanderklay/t3code-flake that referenced this pull request Oct 14, 2026
## What's Changed
* fix(clients): # suggestions include pull requests linked to the thread by @t3dotgg in pingdotgg/t3code#19357
* fix(clients): pairing a switched-off computer again turns it back on by @t3dotgg in pingdotgg/t3code#19354
* fix(cli): t3 triage reports the server's version, not its own, as the user's build by @t3dotgg in pingdotgg/t3code#19359
* fix(client-runtime): a new WSL backend no longer shows Limited permissions until reload by @t3dotgg in pingdotgg/t3code#19361
* fix(web): action shortcuts recorded in the browser now save by @t3dotgg in pingdotgg/t3code#19365
* fix(clients): large pasted images no longer break later Claude image reads by @t3dotgg in pingdotgg/t3code#19364
* fix(server): settled and idle-released threads no longer stay Waiting by @t3dotgg in pingdotgg/t3code#19355
* perf(client-runtime): merged pull requests are no longer re-read every minute by @t3dotgg in pingdotgg/t3code#19374
* fix(server): new Codex threads no longer miss slow MCP servers' tools by @t3dotgg in pingdotgg/t3code#19368
* fix(github): requested teams now show in pull request reviewers by @t3dotgg in pingdotgg/t3code#19375
* fix(ssh): SSH launch no longer picks a port another server answers on by @t3dotgg in pingdotgg/t3code#19372
* fix(server): a failed T3 Connect relink no longer leaves a stale managed tunnel by @t3dotgg in pingdotgg/t3code#19383
* fix(shared): Windows .cmd shims no longer print DEP0190 on every spawn by @t3dotgg in pingdotgg/t3code#19385
* fix(server): commit and title generation use your custom model when no text model is set by @t3dotgg in pingdotgg/t3code#19386
* fix(web): T3 Connect settings can repair a link that drifted to publish-only by @t3dotgg in pingdotgg/t3code#19389
* fix(server): failed Claude text generation shows the CLI's own error by @t3dotgg in pingdotgg/t3code#19394
* fix(web): terminal tells the shell its new width as soon as you release a resize drag by @t3dotgg in pingdotgg/t3code#19395
* fix(web): keybindings page says to connect an environment when none is connected by @t3dotgg in pingdotgg/t3code#19400
* fix(chat): Codex follow-up suggestions show their label instead of raw markup by @t3dotgg in pingdotgg/t3code#19401
* fix(server): open in editor works over Tailscale SSH without a local sshd by @t3dotgg in pingdotgg/t3code#19402
* fix(server): a deregistered T3 Connect host shows it was removed and offers a relink by @t3dotgg in pingdotgg/t3code#19379
* perf(server): idle servers no longer scan every process every 5 seconds by @t3dotgg in pingdotgg/t3code#19399
* chore(typecheck): bump tsc-rs to 0.7.0 by @t3dotgg in pingdotgg/t3code#19408
* fix(server): bound Bitbucket API requests with 30s timeout by @kvnloo in pingdotgg/t3code#14140
* fix(server): new worktrees no longer fail when a background fetch runs at the same time by @t3dotgg in pingdotgg/t3code#19411
* perf(server): thread search runs on the SQLite reader worker by @bompus in pingdotgg/t3code#19382
* perf(server): traces keep ~40% more history and no longer block the event loop by @t3dotgg in pingdotgg/t3code#19430
* fix(shared): SQLite checkpoints no longer fall back to the main thread silently by @t3dotgg in pingdotgg/t3code#19417
* perf(server): unchanged node updates no longer write to SQLite by @t3dotgg in pingdotgg/t3code#19429
* fix(ssh): reconnecting keeps the remote server and its agents running by @t3dotgg in pingdotgg/t3code#19432
* feat(observability): SQL spans show lock wait and connection; stalls keep their own history by @t3dotgg in pingdotgg/t3code#19425
* fix(server): threads woken by notifications no longer load their whole history by @t3dotgg in pingdotgg/t3code#19423
* fix(server): worktree cleanup no longer runs sweeps back to back by @t3dotgg in pingdotgg/t3code#19418


**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261014.3105...v0.0.46-nightly.20261014.3118

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261014.3118
olise007 pushed a commit to olise007/t3code-imaorise that referenced this pull request Oct 15, 2026
…se a resize drag (pingdotgg#19395)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 2cde3f7)
aorwall added a commit to aorwall/t3code that referenced this pull request Oct 15, 2026
Merges `pingdotgg/t3code` `e536bfd33b` (106 commits since `6002c5c68c`)
into the fork. One merge commit; nothing stacked.

## Merge summary

- **Landed:** 475 files against 476 in the upstream range. The one
missing is `package.json`: its only upstream change was the `tsc-rs`
0.7.0 bump, which the fork drops (`root-package-json`). The fork delta
is 809 files.
- **Conflicts (5):**
  - `package.json`: dropped the `tsc-rs` bump.
- `pnpm-lock.yaml`: stripped the `tsc-rs@0.7.0` entries from upstream's
copy and re-derived it.
- `Sidebar.tsx`: kept the fork's thread-list filter and took upstream's
new `useSidebarProjectGroups` hook. That hook sorts project groups by
all thread shells, not by the filtered list.
- `SettingsPanels.tsx`: kept the `serverBehaviorSettings` gate and took
upstream's new description.
- `threadShell.ts`: kept the fork's subagent predicate and took
upstream's `subagentRequests` argument.
- **Fix after the merge:** upstream's new
`useProjectScriptSettings.test.tsx` used `previewUrl`/`autoOpenPreview`.
I changed it to the fork's `port`.
- **Unsupported methods:** nothing to add or drop. `vcs.switchRef` and
`git.preparePullRequestThread` stay as they are.
- **Verification:** `verify.mjs` passes every check except `test`:
- duplicate-adds, tripwires, resolution-check, lockfile, fmt, lint,
typecheck (re-run after the fix) and build all pass.
  - Six test files fail on their own, all because of the sandbox:
- the five recorded in earlier merges: `AgentScope` (`oom_score_adj`),
`ServerBrowserPage` (no Playwright browser), `AcpAdapterV2`,
`OrchestratorReplayFixtures`, `OpenCodeServerLedger`;
- one new: `@t3tools/ssh` `tunnel.test.ts` from upstream pingdotgg#19432. It
fails the same way `AcpAdapterV2` does: a killed process is never
reaped, so it still reads as alive. The fork does not touch
`packages/ssh`.
  - `@t3tools/web` tests pass after the fix.
- Details are in `docs/fork/upstream-merge-log.md`. `docs/fork/gaps.md`
has new notes under five existing entries: capabilities, settlement
rules, pull request link, Orchestrator V2 (transcript read) and runtime
fixes.

## Usable as-is

- Waiting status icon and elapsed timer in the sidebar (pingdotgg#19617)
- The settle shortcut moves on to the next thread, the same way the
sidebar does (pingdotgg#19328)
- Terminal resize, recorded-shortcut save, a keybindings page that
prompts to connect, and settings that save after a stored value fails to
decode (pingdotgg#19395, pingdotgg#19365, pingdotgg#19400, pingdotgg#19312)
- The Mermaid code toggle stays in place, cursor stops stay outside
styled markers, and live reasoning stays scrolled while it streams
(pingdotgg#19601, pingdotgg#19651, pingdotgg#19334)
- PR filters hide Scratch and the project filter follows sidebar order;
`#` suggestions include the thread's PRs; merged PRs are no longer
re-read every minute (pingdotgg#19179, pingdotgg#19180, pingdotgg#19357, pingdotgg#19374)
- New provider-update-checks copy (pingdotgg#18208), shown only where the fork's
`serverBehaviorSettings` gate already shows that row
- Dependency bumps: Effect 4.0.4, OpenCode 2.0.28. `tsc-rs` 0.7.0 is
deliberately dropped.

## Unsupported in Moatless / needs implementation

- **Auto-settle keeps threads with a PR** (pingdotgg#14642): adds the
`sidebarAutoSettleKeepPullRequests` setting and the
`threadAutoSettlementScope` capability. Moatless does not report the
capability, so the row stays hidden.
- **Settled-worktree cleanup** (pingdotgg#15208): adds the
`worktreeSettledAfterDays` setting and the `settledWorktreeCleanup`
capability (Storage settings). Not reported, so the row is hidden.
- **Thread transcript HTTP read** (pingdotgg#15210): `GET
/api/orchestration/threads/:threadId/transcript`, used only for a thread
dropped in from another environment. Moatless does not route it, and a
single-environment deployment cannot reach it.
- **`thread.pull-request-link-updated` event** (pingdotgg#19248): Moatless sends
no pull-request frames; it changes the listing instead.
- **Delegated-task question handling**: `hasPendingQuestion` on the
orchestrator MCP task result (pingdotgg#18459, pingdotgg#19521, pingdotgg#19538).
- T3 Connect revoked links, SSH and Tailscale, pairing, and desktop- and
mobile-only items: not used by the Moatless web client.

## Backend behavior to consider reproducing in Moatless

- Inactivity auto-settle that skips PR-linked threads (pingdotgg#14642); settled
and idle-released threads stop reading as Waiting (pingdotgg#19355)
- A retention sweep for settled threads' workspaces (pingdotgg#15208, pingdotgg#19418)
- Store a PR link only when it changes, and stop re-reading merged PRs
each turn (pingdotgg#19248, pingdotgg#19344)
- GitHub reviewers include requested teams (pingdotgg#19375); new worktrees
survive a concurrent fetch (pingdotgg#19411)
- Commit and title generation fall back to the custom model (pingdotgg#19386)
- Claude: `managed-mcp.json` is honoured and a 403 no longer says to log
in (pingdotgg#18706, pingdotgg#15872)
- Codex: "Always allow this session" works and slow MCP servers no
longer drop tools (pingdotgg#19635, pingdotgg#19368)
- CLIs behind mise wrappers no longer time out (pingdotgg#19340); cold usage
scans stop stalling the server (pingdotgg#19446); a single database owner is
enforced, with exit code 78 (pingdotgg#16102)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---
Moatless task:
https://moatless.soaplabstest.com/tasks/4979b4c3-e4cc-4911-849b-adb94cb65be6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants