display-message -p #{mouse} doesn't reflect the state of mouse option

16 views
Skip to first unread message

Narendran Gopalakrishnan

unread,
Jul 19, 2026, 8:29:11 AM (2 days ago) Jul 19
to tmux-...@googlegroups.com
Hi,

I have a script written in 2022 that reads the mouse option and sets the pointer style accordingly. When I tried it today (after a long) time, in 3.7b, found the script had stopped working, and the reason turned out to be that display -p '#{mouse}' now always displays 0 irrespective of the state of the mouse option. I have worked around with `show -gv mouse` instead, but wondering if this new behavior is intended.

Reproduction (display-time option used for comparison - its display changes while mouse's doesn't):

~ ▶ tmux set -g mouse off\; set -g display-time 751\; show -g mouse\; display -p 'mouse:#{mouse} display-time:#{display-time}'
mouse off
mouse:0 display-time:751
~ ▶ tmux set -g mouse on\; set -g display-time 752\; show -g mouse\; display -p 'mouse:#{mouse} display-time:#{display-time}'
mouse on
mouse:0 display-time:752

Thanks & Regards,
Narendran Gopalakrishnan.

Nicholas Marriott

unread,
Jul 19, 2026, 1:15:54 PM (2 days ago) Jul 19
to Narendran Gopalakrishnan, tmux-...@googlegroups.com
$ ./tmux -V
tmux 3.7b
$ ./tmux -Ltest -f/dev/null start\; set -g mouse on\; set -g display-time 752\; show -g mouse\; display -p 'mouse:#{mouse} display-time:#{display-time}'
mouse on
mouse:1 display-time:752


--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/tmux-users/CAOm%2B6sD9xt7PwbzCFKhBSV-2nfKoBDjjZk5A9Y%2Bf1OE8YJu_XA%40mail.gmail.com.

Narendran Gopalakrishnan

unread,
Jul 19, 2026, 10:48:38 PM (2 days ago) Jul 19
to Nicholas Marriott, tmux-...@googlegroups.com
Strange, today (after the daily reboot) even my tests show that the option and display are in sync! Either there is a Heisenbug (uninitialized variable say) or I have a HW (RAM?) problem. As no one else has reported such issues, it is likely the latter. Thanks a lot for looking into this.

~ ▶ tmux set -g mouse off\; set -g display-time 751\; show -g mouse\; display -p 'mouse:#{mouse} display-time:#{display-time}'
mouse off
mouse:0 display-time:751
~ ▶ tmux set -g mouse on\; set -g display-time 752\; show -g mouse\; display -p 'mouse:#{mouse} display-time:#{display-time}'
mouse on
mouse:1 display-time:752

--

Regards,
Narendran Gopalakrishnan.

Narendran Gopalakrishnan

unread,
Jul 20, 2026, 2:02:21 AM (yesterday) Jul 20
to Nicholas Marriott, tmux-...@googlegroups.com
Gladly, neither is this a heisenbug nor a HW issue. Before my tests I had done a 'set-option mouse off' that set the session option, completely forgetting that it overrides the 'global session' option. Subsequently my tests/script used set-option -g and show-option -g which both targeted the 'global session' option. On the other hand, display -p showed the overriding session option and ignored the changes to the global session options.

To avoid this inconsistent state, I have tweaked my script to entirely to use the overriding session scope (ie. no -g).

BTW, it might be helpful if the FORMAT documentation in man stresses this (information obtained from format_find()):

When a format refers to an option by name (for example, #{mouse}), tmux expands it to the effective option value by searching option scopes in the following order:

  1. Server options
  2. Pane options
  3. Window options
  4. Global window options
  5. Session options
  6. Global session options

The first matching option is used. For a given option, only the scopes in which that option is defined are applicable (for example, mouse is a session option, so the lookup is session → global session).

--

Regards,
Narendran Gopalakrishnan.
Reply all
Reply to author
Forward
0 new messages