Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug print the values of tmux settings?

Tags:

debugging

tmux

For example, if I want to know the value of textwidth in vim, I can dereference it by appending a ?. Thus, I will simply type :set textwidth?.

How can you do the equivalent in tmux?

like image 317
Ari Sweedler Avatar asked Sep 04 '25 17:09

Ari Sweedler


1 Answers

To dereference the value of a tmux setting or variable, you can run the following terminal command:

tmux display-pane -p #{<setting-or-variable-name>}

Or, to be more verbose

tmux display-pane -p "The value of your setting or variable is #{<setting-or-variable-name>}"

Example of a working command:

tmux display-message -p "You have #{display-panes-time}ms to press a number key after running 'display-pane'"

Note: The corresponding command-prompt commands, surprisingly, will fail:

:display-pane #{display-panes-time}
:display-pane #{display-panes-colour}

However, when you add quotes, they act as expected:

:display-pane "#{display-panes-time}"
:display-pane "#{display-panes-colour}"

What...?

like image 110
Ari Sweedler Avatar answered Sep 07 '25 20:09

Ari Sweedler