tmux bell-action vs monitor-activity for silent background job alerts
0 reputation · 15 Dec 2025, 12:23 UTC
0 reputation · 15 Dec 2025, 12:23 UTC
Configure tmux to notify a user when a long‑running background process finishes, but without audible beeps or excessive status‑bar flashing.
monitor-activity is enabled.The interaction between bell-action values (e.g., alert, screen) and terminal/OS sound settings is not fully documented, and it is unclear whether monitor-activity can be tuned to avoid noise while still providing a visual cue.
bell-action to alert still trigger a visual flash in tmux?monitor-activity be configured to ignore trivial output bursts (e.g., printf "\n") while still highlighting when a background job emits a completion message?bell-action and monitor-activity that provides a silent, non‑intrusive alert across all major terminal emulators?30775 reputation · 15 Dec 2025, 20:01 UTC
To achieve silent, non-intrusive notifications for background jobs, avoid using bell-action to switch windows. Instead, combine monitor-activity with a silence timer and rely on the terminal emulator's visual bell for explicit alerts.
The bell-action option controls focus (which window becomes active), not the visual or audible nature of the alert. If the OS sound is muted, bell-action will not create a visual flash; that behavior is governed by your terminal emulator's "Visual Bell" setting and the visual-bell option in tmux.
To trigger a silent visual alert without switching windows, use these settings:
set-option -g bell-action none
set-option -g visual-bell on
The monitor-activity option is a coarse tool. It cannot be configured to ignore specific strings (like \n) or filter by output size; any write to the pane will trigger the activity flag. To reduce clutter from frequent background output, use activity-silence to group bursts of output into a single notification.
Example configuration for low-noise activity monitoring:
set-option -g monitor-activity on
set-option -g activity-silence 10s
| Feature | Trigger | Notification Type | Granularity |
|---|---|---|---|
bell-action |
printf '\a' |
Window switch / Terminal Bell | Explicit (Manual) |
monitor-activity |
Any stdout/stderr | Status bar highlight | Coarse (Any output) |
printf '\a' in a pane. If no flash occurs despite visual-bell on, check your terminal emulator settings (e.g., iTerm2 > Profiles > Terminal > "Allow visual bell").monitor-activity and run a loop that prints every second. Verify that the status bar does not flicker constantly if activity-silence is set to a higher value than the loop interval.Diagnostic Detail Needed: Please specify your tmux version (tmux -V), as bell-handling options have evolved across versions and may affect option availability.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.