Description
Tmux Continuum auto-save not working consistently in WSL2 Ubuntu
In WSL2 Ubuntu, tmux-continuum's automatic saving functionality only works when the terminal window is in focus. This appears to be related to how WSL2 handles background process persistence when the terminal isn't actively being used.
Environment
- OS: Windows with WSL2
- WSL Distribution: Ubuntu
- tmux version: 3.2a
- tmux config:
# Termi colors
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
# Mouse
set -g mouse on
# Status bar colors
set -g status-style bg='#121212',fg=white
# Window list
set -g window-status-format "#[bg=#121212,fg=#6b6b6b] #IÔïà#W "
set -g window-status-current-format "#[bg=#222222,fg=#00dcf0] #Iƒ×ä#W "
set -g window-status-separator ""
# Pane borders
set -g pane-border-style fg='#222222'
set -g pane-active-border-style fg=gray
# Status bar content
set -g status-left "#[fg=#6b6b6b][#S] "
set -g status-right "#{continuum_status} #[fg=#6b6b6b]%m-%d %H:%M "
set -g status-left-length 100
# Menu colors
set -g message-command-style bg='#222222',fg='#6b6b6b'
set -g copy-mode-match-style bg='#222222',fg='#00dcf0' # Search matches
set -g copy-mode-current-match-style bg='#00dcf0',fg='#222222' # Current search match
# Menu selection colors
#set -g mode-style "bg=#222222,fg=#6b6b6b" # Menu background
#set -g mode-active-style "bg=#00dcf0,fg=#222222" # Selected item
set -g mode-style "bg=#222222,fg=#00dcf0"
set -g message-style "bg=#222222,fg=#00dcf0"
set-option -g @tmux_plugin_path '~/.config/zsh/tmux/.tmux/plugins/'
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Configure continuum
set -g @continuum-save-interval '10'
set -g @continuum-restore 'on'
# Configure resurrect
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-processes 'btop cmatrix "~git diff->git diff" docker * "flask run *"'
set -g @resurrect-dir '~/.config/zsh/tmux/.tmux/resurrect'
# Initialize TMUX plugin manager
run '~/.config/zsh/tmux/.tmux/plugins/tpm/tpm'
# History
set-option -g history-limit 50000
The Behavior I observed
- Manual saves with
Ctrl+b Ctrl+s
work correctly - Automatic saves happen sporadically
- Auto-saves only occur when the terminal is in focus/active
- When setting interval to 1 minute, a few automatic saves happen and then stop
- Long gaps between auto-saves despite short interval setting
Expected behavior
Automatic saves should occur at the configured interval (every 1 or 5 minutes) regardless of whether the terminal window is in focus.
Fixes Tried
- Confirmed the plugin is loaded correctly
- Verified resurrect directory permissions
- Checked process list (
ps aux | grep tmux-continuum
) - Attempted different save intervals
- Manually ran the
continuum_save.sh
script (works when manually triggered)
Additional Context
This appears to be related to how WSL2 handles background processes. When the terminal isn't in focus, WSL seems to suspend or throttle background processes, preventing tmux-continuum from executing its save script at the configured intervals. The save script will only work if the terminal is in focus when the interval hits.
Question
Is there a way for tmux-continuum to better handle the WSL environment constraints, or could there be documentation added about WSL-specific configurations needed?