Current behavior
Closing the host terminal (Ghostty) without detaching first (Ctrl+B Q) causes the herdr client to crash with SIGABRT. A core dump is generated. The crash occurs when the client attempts to write to stderr after the terminal's file descriptors have become invalid.
Expected behavior
The herdr client should handle terminal death gracefully — clean disconnect and exit cleanly (exit 0 or exit 1) instead of panicking/aborting. For comparison, tmux handles this scenario without crashing.
Reproduction
- Open herdr in a terminal (
herdr)
- Open a few panes/tabs
- Close the terminal window directly (do not detach with
Ctrl+B Q first)
- Core dump is generated
Impact
Core dump occurs every time the terminal is closed without detaching. This is a common mistake, especially when closing multiple windows quickly. The core dump fills systemd journal and coredumpctl with crash reports.
Environment
- herdr v0.8.0 stable
- OS: CachyOS (Arch-based), Linux
- Terminal: Ghostty 1.3.1
- Shell: Fish 4.8.1
- Session: Wayland
Additional context
The crash stack trace shows the abort happens in std::io::default_write_fmt → Stderr::write_str — the client panics when trying to write to stderr after the terminal FD is closed.
Current behavior
Closing the host terminal (Ghostty) without detaching first (
Ctrl+B Q) causes the herdr client to crash with SIGABRT. A core dump is generated. The crash occurs when the client attempts to write to stderr after the terminal's file descriptors have become invalid.Expected behavior
The herdr client should handle terminal death gracefully — clean disconnect and exit cleanly (exit 0 or exit 1) instead of panicking/aborting. For comparison, tmux handles this scenario without crashing.
Reproduction
herdr)Ctrl+B Qfirst)Impact
Core dump occurs every time the terminal is closed without detaching. This is a common mistake, especially when closing multiple windows quickly. The core dump fills systemd journal and coredumpctl with crash reports.
Environment
Additional context
The crash stack trace shows the abort happens in
std::io::default_write_fmt→Stderr::write_str— the client panics when trying to write to stderr after the terminal FD is closed.