Long-running commands in a background tmux window can finish without drawing attention when the current window stays quiet. Activity monitoring marks a window after new output arrives while another window is selected, so the status line shows which background job needs attention before switching back.
Tmux treats monitor-activity as a window option. Setting it globally makes windows that inherit the global option raise an activity alert, and visual-activity controls whether tmux also shows a message for that alert instead of only marking the window list.
Activity alerts are cleared when the flagged window becomes current. Enable the setting in sessions where background output means a job finished, a log changed, or a build printed an error. Noisy commands can keep raising alerts, so verify the change by forcing output in a temporary background window before relying on it for real work.
Related: How to customize the tmux status bar
Related: How to select a window in tmux
$ vi ~/.tmux.conf
tmux also reads $XDG_CONFIG_HOME/tmux/tmux.conf or ~/.config/tmux/tmux.conf when those paths are used instead of ~/.tmux.conf.
set-window-option -g monitor-activity on set-option -g visual-activity on
monitor-activity marks windows after background output. visual-activity makes tmux show an activity message as well as the status-line marker.
$ tmux source-file ~/.tmux.conf
No output means tmux accepted the file and applied the settings to the running server. Use the same config path here when you edited an XDG tmux.conf file instead of ~/.tmux.conf.
Related: How to reload the tmux config
$ tmux show-options -gw monitor-activity monitor-activity on
The -w flag checks the window-option layer, and -g checks the global value inherited by windows without a local override.
$ tmux show-options -g visual-activity visual-activity on
$ tmux new-window -d -n activity-test 'sleep 5; echo activity check; sleep 300'
The -d flag keeps the current window selected, so the temporary window is in the background when its output appears.
Related: How to create a window in tmux
$ tmux display-message -p -t :activity-test '#{window_activity_flag}'
1
1 means tmux recorded activity for that window. The window list also shows a # activity marker and uses the activity style until the window becomes current.
$ tmux kill-window -t :activity-test