Tmux: How do I find out the currently running version of tmux?

Most obvious, but not 100% correct way is to execute this command in console

$ tmux -V

and receive output like this tmux 2.9a with version of tmux INSTALLED, not currently running. In 99% cases it is enough, but there can be subtle nuances.

Command tmux -V will return version of tmux installed at /usr/bin/tmux or any other directory inside your PATH variable. If you have tmux already running, it is possible that tmux can be started from binary of other version and from different place (for example, tmux can be started from /home/user/bin/tmux). In this case, you have to call

$ ps  -e | grep tmux

to see PID of all tmux processes currently running. It will output something like this

[vodolaz095@ivory ~]$ ps -e | grep tmux
19699 pts/0    00:00:00 tmux: client
19701 ?        00:00:00 tmux: server

Here, number 19701 depicts process id (PID) of currently running tmux server.

After getting PID of tmux server, you can ran command


$ lsof -p 19701

to get information about CURRENTLY RUNNING tmux server process (in my case its 19701) that will output something like this (Figure 1)

COMMAND     PID       USER   FD   TYPE             DEVICE  SIZE/OFF     NODE NAME
tmux:\x20 19701 vodolaz095  cwd    DIR               8,33      4096 22544385 /home/vodolaz095
tmux:\x20 19701 vodolaz095  rtd    DIR                8,1      4096        2 /
tmux:\x20 19701 vodolaz095  txt    REG                8,1    677760  3675332 /usr/bin/tmux
tmux:\x20 19701 vodolaz095  mem    REG                8,1   6406312   131327 /var/lib/sss/mc/group

as you can see, tmux currently running was executed from binary placed in /usr/bin/tmux.

Or, you can call one liner


    lsof -p `pgrep 'tmux: server'`

to achieve the same output as Figure 1

After you get path to tmux binary CURRENTLY RUNNING, (in my case, it was /usr/bin/tmux), you can execute this binary with flag -V to get its version


/usr/bin/tmux -V

or, if tmux was installed by limited user into /home/user/bin/tmux,


/home/user/bin/tmux -V

And, as result, you'll get version of tmux currently running, not the one, that was installed.


As pointed out in a comment, tmux -V returns the version:

$ tmux -V
tmux 3.0a

Tested on Centos 7 and OSX 12.5.

Tags:

Tmux