tmux log-file silent failure when deployment script lacks write permission
0 reputation · 21 Mar 2023, 08:47 UTC
Goal
Capture the complete output of a deployment script running inside a tmux pane so that a later post‑mortem can correlate the exact error messages and exit status.
Constraints and uncertainty
The log-file option (global or per‑window) appends raw pane output—including ANSI escape sequences—without timestamps or rotation. Logging begins only for panes created after the option is set; existing panes are unaffected. If the target log file cannot be written due to permission problems, tmux fails silently and no output is recorded, leaving no indication that logging stopped.
Questions
- What is the most reliable way to verify that logging is active for a specific pane before starting a long‑running deployment?
- How can ANSI escape sequences be stripped or rendered after the fact so that error messages remain readable in the log file?
- Is there a built‑in mechanism or common pattern to rotate or size‑limit the log file without external tooling?