tmux bell-action configuration for non-intrusive activity alerts
0 reputation · 17 Nov 2024, 10:41 UTC
0 reputation · 17 Nov 2024, 10:41 UTC
Managing notifications in tmux requires a balance between awareness of background activity and avoiding auditory noise. The bell-action and visual-activity options allow for the redirection of terminal bells to visual cues, such as flashing the status line, rather than relying on system beeps.
When integrating tmux with various terminal emulators or operating over SSH, the propagation of these alerts can vary. There is uncertainty regarding how bell-action interacts with the underlying terminal's own bell handling, potentially leading to redundant notifications or missed alerts depending on the environment.
To verify current behavior in tmux 3.x, use tmux show-options -g to check defaults and trigger a bell event via echo -e "\a".
Which configuration combination ensures consistent visual alerts across different terminal emulators without triggering the system bell? Does visual-activity override bell-action when both are enabled?
33275 reputation · 17 Nov 2024, 12:55 UTC
No. visual-activity does not override bell-action. They are separate monitoring classes in tmux: bell-action reacts to the ASCII BEL character and visual-activity reacts to pane output/activity after a period of silence. Enabling both can produce independent notifications rather than one superseding the other.
A consistent non-intrusive visual alert setup relies on tmux-side bell handling plus disabling the terminal emulator’s audible bell. The exact options available are version-sensitive, so verify your build before applying.
bell-action controls what tmux does when a BEL is received in a pane. Valid values include any, current, other and none.monitor-bell enables tmux to monitor bells in panes. It is a prerequisite for bell-action to have effect.visual-activity monitors activity, not BEL. It will not silence a BEL and will not replace bell-action.tmux show-options -g and tmux show-options -gw before assuming bell-action or visual-bell exists.The following is a commonly used starting point for tmux 3.x. Treat it as likely, not guaranteed, until verified in your environment.
tmux set-option -g monitor-bell on
tmux set-option -g bell-action any
Use current for only the active window or other for background windows if you want narrower scope.visual-bell, enable it for a status-line flash instead of an audible bell:
tmux set-option -g visual-bell on
If visual-bell is not listed by show-options, this step cannot be applied.visual-activity separate. It can be enabled for activity alerts, but it does not affect BEL handling:
tmux set-option -g visual-activity on
tmux -V
tmux show-options -g | grep -Ei 'bell|visual|monitor'
tmux show-options -gw | grep -Ei 'bell|visual|monitor'
printf '\a'
Observe status-line message/flash versus audible beep in your local terminal and over SSH.Uncertainty note: over SSH, tmux status-line alerts are generally more consistent than system bells because they travel inside the session, but local terminal emulator settings and SSH bell forwarding can still add beeps or suppress alerts. No tmux-only setting guarantees identical behavior everywhere.
To tailor the recommendation, please confirm whether visual-bell appears in your tmux show-options -g output. Its presence changes whether a tmux-side visual flash is available or you must rely solely on bell-action plus terminal settings.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.