2

I am using tmux 3.4 on Ubuntu noble 24.04.3. I would like tmux to handle bells as follows:

  • If a bell occurs in the current window, echo it and don't do anything else.
  • If a bell occurs in a window other than the current one, echo it and also display a message at the bottom of the screen. (I'll settle for just the message if doing both isn't possible.)

I currently have the following bell-related options set in my ~/.tmux.conf:

set -g bell-action any set -g visual-bell both set -wg monitor-bell on 

This does what I want when a bell occurs in an inactive window, but when a bell occurs in the current window, I get both a bell and the message, which is annoying. Changing bell-action to other gets rid of the message but also suppresses all bells in the current window entirely, which is even worse.

How can I tell tmux to do what I want with bells?

0

1 Answer 1

1

I ended up posting an issue about this on tmux's GitHub repository, and a maintainer replied with good news and bad news. The good news is that I can get what I want with the following configuration:

set -g bell-action any set -g visual-bell off set-hook -g alert-bell { if -F "#{!:#{window_active}}" 'display "Bell in window #{window_index}"' } 

The bad news is that this relies upon some change to hooks that's in the dev version of tmux but not in the latest release (v3.5a at time of writing). Hopefully v3.6 comes out soon with support for this.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.