Repository navigation
Conversation
New `rat watch <id>` subcommand: attaches over the Unix socket and
replays + tails the session's PtyOutput to stdout, but never sends
ClientMsg::Input, Detach, or Resize. The interactive attacher (if
any) is completely untouched.
Implementation notes:
- Stays in cooked mode so the terminal's line discipline handles
Ctrl-C → SIGINT cleanly, which the tokio signal task traps and
uses to notify the read loop to exit.
- Reuses OutputFilter so keyboard-protocol enables from inner TUIs
don't bleed into the watcher's terminal.
- Suppresses SessionEnded-based exit distinction with the shared
`print_session_ended` banner so ending a session while watching
is visually consistent with ending while attached.
Useful for pair/review ("peek without risk of typing"), CI-style
monitoring via `rat watch x > log`, or any tool that wants a live
byte stream from a session without the raw-mode contract of attach.
seamoss
force-pushed
the
feat/watch-readonly
branch
from
April 24, 2026 23:21
351e902 to
19b5bc0
Compare
1 of 3 tasks
Owner
Author
|
Superseded by #11 — combined to avoid peer-merge conflict churn. Original commit preserved there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
`rat watch ` attaches and tails output but never sends anything back — no input, no detach, no resize. The interactive attacher is untouched.
```sh
rat watch agent # follow live
rat watch agent | tee agent.out # capture to file
```
Ctrl-C stops watching. Uses the same OutputFilter as `rat attach` to keep kitty-CSI-u enables out of the watcher's terminal.
Test plan