Skip to content

fix(minimald): fix resizing terminal - #969

Merged
twitchyliquid64 merged 1 commit into
mainfrom
tom/completions
Jul 25, 2026
Merged

fix(minimald): fix resizing terminal#969
twitchyliquid64 merged 1 commit into
mainfrom
tom/completions

Conversation

@twitchyliquid64

@twitchyliquid64 twitchyliquid64 commented Jul 25, 2026

Copy link
Copy Markdown
Member

Fixes: #965

Dragged claude code around a bunch, seemed to update the screen properly.

Note

Fix terminal resizing in minimald by handling SSH WindowChange events

Introduces a StdinMsg enum in session_host.rs to replace the previous Either<Bytes, RequestedPty> channel type. The new enum adds a WindowChange variant that carries terminal dimensions, allowing the SSH binding to forward resize events to the host's main loop, which calls set_size with the updated dimensions.

Macroscope summarized 7e5e080.

Summary by CodeRabbit

  • New Features

    • Improved terminal session handling for SSH connections.
    • Terminal size changes now update the remote terminal and screen automatically.
    • Standard input and terminal resize events are handled independently for more reliable interaction.
  • Bug Fixes

    • Improved processing of terminal input, including control-key detection.
    • Updated session behavior to respond correctly to terminal resize requests.

@twitchyliquid64
twitchyliquid64 enabled auto-merge (squash) July 25, 2026 06:25
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

SSH input and resize routing

Layer / File(s) Summary
StdinMsg contract and SSH forwarding
crates/minimald/src/session_host.rs
SSH data, PTY requests, and window changes now use typed StdinMsg channel messages.
Host handling and regression updates
crates/minimald/src/session_host.rs
Host::step processes byte input and applies terminal-size updates to the PTY and parser; affected tests use StdinMsg::Bytes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • gominimal/minimal#964 — Addresses the same SSH WindowChange path by forwarding resize requests to Host::set_size.
  • gominimal/inbox#362 — Modifies the same session-host SSH channel handling to forward and apply window-change updates.

Possibly related PRs

  • gominimal/minimal#968 — Closely related changes route SSH resize events into the host PTY-size update path.

Suggested reviewers: norrietaylor

Poem

A rabbit hops through bytes in flight,
With window changes sized just right.
The PTY grows, the screen keeps pace,
No scrambled lines remain in place.
Typed messages guide the way—
Hop, resize, and code all day!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description mentions the fix but does not follow the required template and omits explicit Summary, Testing, and Checklist sections. Rewrite the PR description using the template, with clear Summary, Testing, and Checklist sections, and note any docs or breaking-change status.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes forward window-change resizing into session_host and update PTY/parser size as required by #965.
Out of Scope Changes check ✅ Passed The diff appears focused on terminal-resize plumbing and related tests, with no clear unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title matches the main fix and follows the Conventional Commit style required by the template.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/minimald/src/session_host.rs`:
- Around line 1802-1804: Add a regression test covering the window-change path
from ChannelMsg::WindowChange through Binding to Host::set_size, rather than
only StdinMsg::Bytes. Assert that the PTY and parser dimensions update after the
request, including the oversized-dimension behavior described by the
implementation.
- Around line 1553-1559: Clamp col_width, row_height, pix_width, and pix_height
to the u16 range in the StdinMsg::WindowChange handler before casting them and
constructing WinSize. Match the existing bounds used by
WinSize::from(&RequestedPty), preserving valid values while preventing oversized
SSH dimensions from wrapping.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 708268a9-8722-4fce-976b-12522771ee80

📥 Commits

Reviewing files that changed from the base of the PR and between 9654970 and 7e5e080.

📒 Files selected for processing (1)
  • crates/minimald/src/session_host.rs

Comment thread crates/minimald/src/session_host.rs
Comment thread crates/minimald/src/session_host.rs
@twitchyliquid64
twitchyliquid64 merged commit e4d79ca into main Jul 25, 2026
29 checks passed
@twitchyliquid64
twitchyliquid64 deleted the tom/completions branch July 25, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

diag: minimald's session host never applies SSH window-change requests: the attached-binding message loop in c

2 participants