How to Auto-Log Every tmux Pane Using a Custom Shell Script
A developer has shared a method to automatically log all tmux pane activity from the moment each pane is created, addressing a limitation of the existing tmux-logging plugin, which only supports manual toggling. The solution combines the tmux-logging plugin with a custom shell script that uses awk with per-line flushing to ensure logs are written in real time rather than buffered. Three tmux hooks cover every way a new pane can be created — new session, new window, or split window — so no pane is missed. Configuration is managed through the standard .tmux.conf file, and users can also toggle logging manually for any pane using a key binding. The setup was written and tested on macOS with tmux 3.7c, BSD awk, and zsh.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in