Skip to content

fix: implement dynamic PTY resize (ResizePty)#57

Merged
miguelgila merged 1 commit intomainfrom
fix/resize-pty-no-op
Mar 21, 2026
Merged

fix: implement dynamic PTY resize (ResizePty)#57
miguelgila merged 1 commit intomainfrom
fix/resize-pty-no-op

Conversation

@miguelgila
Copy link
Owner

Summary

  • Implements file-based IPC between shim and runtime daemon for PTY resize
  • Shim writes width height to /run/reaper/<id>/resize (or exec-<exec_id>-resize for exec sessions)
  • Runtime daemon polls the resize file every 100ms and applies TIOCSWINSZ ioctl to the PTY master fd
  • Supports both do_start() and exec_with_pty() PTY sessions
  • All Linux-specific code properly gated with #[cfg(target_os = "linux")]

Closes #56

Test plan

  • cargo clippy --workspace --all-targets -- -D warnings passes (macOS)
  • cargo clippy --target x86_64-unknown-linux-gnu --all-targets -- -D warnings passes (Linux cross-compile)
  • cargo test --workspace passes (152 tests)
  • Manual verification: kubectl exec -it <reaper-pod> -- bash and resize terminal window, then run ps auxf to confirm full-width output

🤖 Generated with Claude Code

@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.78%. Comparing base (b890734) to head (9e1ac78).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #57      +/-   ##
==========================================
- Coverage   85.01%   84.78%   -0.23%     
==========================================
  Files           6        6              
  Lines         307      309       +2     
==========================================
+ Hits          261      262       +1     
- Misses         46       47       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The shim's ResizePty was a no-op, causing interactive terminals to be
stuck at 80x24. Implement file-based IPC between shim and runtime daemon:

- Shim writes "width height" to /run/reaper/<id>/resize (or exec variant)
- Runtime daemon polls the resize file every 100ms via a watcher thread
- On change, daemon applies TIOCSWINSZ ioctl to the PTY master fd

Supports both do_start() and exec_with_pty() PTY sessions.

Closes #56

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@miguelgila miguelgila force-pushed the fix/resize-pty-no-op branch from f075ca6 to 9e1ac78 Compare March 21, 2026 17:06
@miguelgila miguelgila merged commit 0353a09 into main Mar 21, 2026
20 checks passed
@miguelgila miguelgila deleted the fix/resize-pty-no-op branch March 21, 2026 21:41
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.

fix: PTY defaults to 80 columns (ResizePty is no-op)

1 participant