Fix/exit display (#4)

* fix exit output
This commit is contained in:
David Beesley
2026-01-18 10:41:57 +13:00
committed by GitHub
parent b800ec12b9
commit c7ab4aa06b
2 changed files with 24 additions and 4 deletions

View File

@@ -2,9 +2,9 @@
[![CI](https://github.com/davidbeesley/claude-chill/actions/workflows/ci.yml/badge.svg)](https://github.com/davidbeesley/claude-chill/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/davidbeesley/claude-chill)](https://github.com/davidbeesley/claude-chill/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/davidbeesley/claude-chill)](https://github.com/davidbeesley/claude-chill/network)
![GitHub repo size](https://img.shields.io/github/repo-size/davidbeesley/claude-chill)
![Linux](https://img.shields.io/badge/Linux-supported-green)
![macOS](https://img.shields.io/badge/macOS-supported-green)
![Windows](https://img.shields.io/badge/Windows-unsupported-red)
![Rust](https://img.shields.io/badge/rust-2024-orange)
A PTY proxy that tames Claude Code's massive terminal updates.
@@ -83,9 +83,28 @@ Keys: `[a]`-`[z]`, `[f1]`-`[f12]`, `[pageup]`, `[pagedown]`, `[home]`, `[end]`,
`Ctrl+6` sends 0x1E, a control character not frequently used by terminals, signals, or shells. Avoid `Ctrl+letter` hotkeys - terminals can't distinguish `Ctrl+J` from `Ctrl+Shift+J`.
## How It Works
claude-chill creates a pseudo-terminal (PTY) and spawns Claude Code as a child process. It then acts as a transparent proxy between your terminal and Claude:
```
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Terminal │◄───►│ claude-chill │◄───►│ Claude Code │
│ (stdin/ │ │ (proxy) │ │ (child) │
│ stdout) │ │ │ │ │
└──────────────┘ └──────────────┘ └──────────────┘
```
1. **Input handling**: Keystrokes pass through to Claude, except for the lookback key which toggles lookback mode
2. **Output processing**: Scans output for sync block markers. Non-sync output passes through directly
3. **Sync block buffering**: Accumulates sync block content until the end marker arrives
4. **Truncation decision**: If the sync block contains a full screen clear (`ESC[2J` + `ESC[H`), truncates to the last N lines. Otherwise passes through unchanged
5. **History tracking**: Maintains a rolling buffer of output for lookback mode
6. **Signal forwarding**: Window resize (SIGWINCH), interrupt (SIGINT), and terminate (SIGTERM) signals are forwarded to Claude
## Disclaimer
This tool was developed for personal convenience on Debian Linux. It works for me, but it hasn't been extensively tested across different terminals, operating systems, or edge cases. Don't use it to send anyone to space, perform surgery, or run critical infrastructure. If it breaks, you get to keep both pieces.
This tool was developed for personal convenience. It works for me on Linux and macOS, but it hasn't been extensively tested across different terminals or edge cases. Don't use it to send anyone to space, perform surgery, or run critical infrastructure. If it breaks, you get to keep both pieces.
## Contributing