Created
September 16, 2024 12:53
-
-
Save swtornio/95ea9bb6f2d179f8e6327c94128a5157 to your computer and use it in GitHub Desktop.
Basic tmux config with logging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g history-limit 9999999 | |
set -g mouse on | |
unbind -n MouseDrag1Pane | |
set-window-option -g mode-keys vi | |
set -g base-index 0 # Start window numbers at 0 | |
# Log all panes by default to $HOME/tmux_logs | |
run-shell -b 'if [ ! -d "$HOME/tmux_logs" ];then mkdir $HOME/tmux_logs; fi' | |
# Prefix + c: Enable logging by default when a new window is created | |
bind c new-window\; pipe-pane -o 'bash -c "while IFS= read -r line; do echo \"\$(date +%%Y%%m%%dT%%H%%M%%SZ%%z): \$line\"; done" >>$HOME/tmux_logs/"'%Y-%m-%d-%H:%M:%S'-win#I-pane#P-#W-#S-tmux.log"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment