feat: keep ANSI by default and impl PTY mode#408
Conversation
Greptile SummaryThis PR introduces a Confidence Score: 5/5Safe to merge once the stacked PR #406 lands; implementation is correct and previously flagged issues are all addressed. No P0 or P1 findings. Previously flagged issues (saturating_pow backoff, src/supervisor/lifecycle.rs — the on_output_hook output change and the merged stdout/stderr channel are worth a second read, but both are implemented correctly. Important Files Changed
Reviews (11): Last reviewed commit: "feat: keep ANSI and PTY mode" | Re-trigger Greptile |
d872d05 to
6b07116
Compare
a3dc5f9 to
0fdfd4f
Compare
7721ae6 to
2105f3c
Compare
|
@jdx ready for a review!
|
|
could we just make this default behavior? |
|
you mean keep ANSI as default or strip by default? Now default is strip @jdx |
|
I think we should keep ansi as default unless we've disabled colors, then we should strip when outputting the logs not when storing them |
refactor: config type [autofix.ci] apply automated fixes feat: keep ANSI and pty mode
|
## 🤖 New release * `pitchfork-cli`: 2.8.0 -> 2.9.0 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [2.9.0](v2.8.0...v2.9.0) - 2026-05-03 ### Added - keep ANSI by default and impl PTY mode ([#408](#408)) - customize stop signal and refactor config types ([#406](#406)) - add hook `on_output` ([#399](#399)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
## Summary The v2.9.0 release pipeline failed on both Windows targets (run [25281536062](https://github.com/endevco/pitchfork/actions/runs/25281536062)) due to two recently-merged PRs that didn't cfg-gate Unix-only code: - **#408** added `src/supervisor/pty.rs` (uses `std::os::fd`) and a bare `mod pty;` in `supervisor/mod.rs` — `std::os::fd` doesn't exist on Windows. - **#406** introduced `libc::SIG*` references in `src/config_types.rs`, but `libc` is gated to `[target.'cfg(unix)']` in `Cargo.toml`. This PR: - Gates `mod pty;` behind `cfg(unix)`. - Replaces `libc::SIG*` lookups in `StopSignal` with platform-portable constants — `libc` on Unix (where signal numbers vary across BSD/Linux), hardcoded POSIX-typical values on Windows. The Windows constants are only used for parsing/Display; `procs::kill` ignores `stop_signal` on Windows and uses `TerminateProcess` via `sysinfo`. - Cleans up the incidental Windows-only warnings in the same touched files (unused imports, unused vars, dead-code variant, needless return). - Adds a `windows-build` CI job running `cargo check --lib --bins --all-features` on `windows-latest`. Integration tests under `tests/` use `lsof`/`pkill` and are Unix-only, so we limit the check to lib + bins. This catches the regression in PR CI rather than the release pipeline. A follow-up patch release will be needed since v2.9.0 shipped with no Windows binaries. ## Test plan - [x] `cargo check --all-targets --all-features` (Linux) clean - [x] `cargo check --target x86_64-pc-windows-gnu --all-features` clean - [x] `cargo clippy --all-targets --all-features -- -D warnings` (Linux) clean - [x] `cargo clippy --lib --bins --target x86_64-pc-windows-gnu -- -D warnings` clean - [ ] New `windows-build` CI job passes on this PR 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: changes are primarily platform `cfg` gating and CI configuration to catch Windows-only compile issues; runtime behavior is unchanged except for stop-signal parsing/display constants on Windows. > > **Overview** > Restores Windows compatibility by `cfg`-gating Unix-only modules/imports (e.g. `supervisor::pty`, Unix signal handling) and fixing Windows-only warnings/unused code paths. > > Makes `StopSignal` platform-portable by using `libc` signal numbers on Unix and POSIX-typical constants on Windows, and adjusts Windows process-kill code to ignore unused stop-signal parameters. > > Adds a new GitHub Actions `windows-build` job that runs `cargo check --lib --bins --all-features` on `windows-latest` to catch Windows compile regressions in PR CI. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d3c3830. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
this is a stacked PR and should wait for #406 to be merged.