I know that I can run tmux -V
to find the version of tmux
that is in my PATH
, but how can I get the version of tmux
that is currently running?

- 24,334
- 12
- 145
- 143

- 21,507
- 32
- 115
- 211
5 Answers
As pointed out in a comment, tmux -V
returns the version:
$ tmux -V
tmux 3.0a
Tested on Centos 7 and OSX 12.5.
-
19I don't think this answers the question. I'm not sure why it's rated so highly. That command just returns the version of whatever tmux is in my path. – quant Mar 25 '17 at 00:29
-
9It's because this shows up as the first result of *How to get tmux version*. – Derek 朕會功夫 Aug 21 '17 at 22:56
-
5THIS IS WRONG! THE CORRECT ANSWER IS FROM USER whatintheworld – iconoclast Nov 20 '21 at 06:04
-
@iconoclast for me, this and the other answer you mentioned, both of them worked. – ssi-anik Feb 28 '22 at 18:00
-
1@ssi-anik: It appeared to work. That switch was added at a certain point, so it began to work to show you the _first installed version found in your PATH,_ which is not necessarily the same as _the version you're running._ As time goes by you're less and less likely to run into versions of `tmux` not supporting `-V`, and most of the time you aren't likely to be running one version and having another that appears first in your PATH. But if you really specifically want to know the _**currently running**_ version, then this is not reliable for 2 reasons. – iconoclast Feb 28 '22 at 19:41
-
6Since the question itself mentioned `-V` as not acceptable, why would you think this answers the question??? It specifically excluded this as an answer! – iconoclast Feb 28 '22 at 19:45
-
It was edited to exclude this answer after-the-fact. – sixty4bit Jul 13 '23 at 02:29
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.

- 6,680
- 4
- 27
- 42
-
9It's worth mentioning that this won't work if `tmux` has been upgraded since the given process was started. – nobody Nov 02 '14 at 23:41
-
3
-
58
-
2this method will require you to execute tmux first; instead you could use `which tmux` to find out the path – willowherb Jul 06 '16 at 06:12
-
1@Shiva - question author said "version of tmux that is currently running?" - so tmux is running already – vodolaz095 May 06 '17 at 06:57
-
-
`ps -u` does not list all a user's processes. It lists a user friendly output. For example: ```bash ps -u $(whoami) | grep tmux 3089 ? 00:03:36 tmux: server 5922 pts/3 00:00:00 tmux: client ps -u | grep tmux user 5922 0.0 0.0 19336 2752 pts/3 S+ 12:24 0:00 tmux attach -d ``` ps -u totally misses the tmux server, pid=3089. It also doesn't work on BSD, so no macOS. It also doesn't give the full path to tmux, so you don't know which tmux started the process. Even so, if that path is now a different executable, it wouldn't even help you then. – ClashTheBunny Jun 17 '17 at 17:40
-
2
To get the version of the tmux server you can use display-message.
./tmux2.3 display-message -p "#{version}"
Will show the version of the server (2.7 in my case)
-p will direct the output of stdout so you can script with it and {version} can be anything from the FORMATS section in the man page.
The following will give you the executable of your tmux server, on linux:
realpath /proc/$(tmux display-message -p "#{pid}")/exe
And on macos, proc_pidpath
can be used, see https://stackoverflow.com/a/8149380

- 3,104
- 3
- 26
- 29

- 279
- 3
- 2
-
The `/proc` hack is Linux only (and possibly Solaris etc; but not generally portable) – tripleee Jun 06 '19 at 04:43
-
display-message is the perfect solution for getting the server version! – Ben Bernard Jan 29 '20 at 19:35
-
4In a running tmux client, you can do `:display-message -p "#{version}"` – Epimetheus Sep 23 '20 at 17:35
-
3@quant This should be the selected answer since the display-message approach actually returns the actively running tmux version and as pointed out that could differ from the currently installed one if there was an update after starting the instance. Alltough I simply run "display-message -p "#{version}" in tmux itself using
: as oposed to calling the binary. – MemphiZ Apr 24 '21 at 18:57 -
1On macos, `/proc/` won't work but this does: `proc_pidpath` (which can be wrapped into an executable to be called from bash if needed), see https://stackoverflow.com/a/8149380 – timotheecour May 03 '22 at 07:17
-
BEWARE depending on the version mismatch between tmux client & server`tmux display-message -p "#{pid}"` works immediately, but trying to capture `$()` or pipe `|` that command into into another command can output the correct answer **then hang forever**!! For me (centos 4.1 uptime 400+ days), `ls -l /proc/13802/exe` --> `/usr/bin/tmux;60a77fb0 (deleted)`. OLD: `/proc/13802/exe -V ## 3.1b`. NEW: `/usr/bin/tmux -V ## 3.2a`. `tmux display-message -p "#{pid}" | cat` <-- hangs until ^C. `echo $(tmux display-message -p "#{pid}")/exe` <-- ^C has no effect – DouglasDD May 27 '22 at 15:51
To find the actual version of the tmux that is running, you have to find the PID of the tmux:
pgrep tmux
With this info, you can check the version by running:
lsof -p $tmuxPID | grep REG | grep -i -e deleted -e "tmux$"
If there is not a (deleted) next to the tmux file listed, you can just run that file with a -V
.
If it results in files that are "(deleted)", you are running an old, uninstalled version. If you are on linux, you can figure out what it is by running:
/proc/$tmuxPID/exe -V`
If you are on OS X, you are stuck with whatever information is in the path to the filename, possibly something like Cellar/tmux/<version number>/bin/tmux
.
You can combine many of these steps into the following one-liner:
for tmuxPID in $(pgrep tmux); do lsof -p $tmuxPID | grep REG | grep -i -e deleted -e "tmux$"; done
Or if you are on Linux, this always works:
for tmuxPID in $(pgrep tmux); do /proc/$tmuxPID/exe -V; done

- 32,692
- 6
- 40
- 59

- 251
- 4
- 9
Send prefix (default: ctrl-B) and then type:
:display-message "#{version}"
this will display version in the status bar

- 246
- 2
- 8