Is there a way to get the id of the active panel for tmux panels

I am writing a bash script that scans all open panels and executes several send-keys commands. Except that I want to apply some other logic to the panel, I execute this script to prevent the disconnection of the send keys from the script.

Is there a command to get the ID of the panel I'm working in now for tmux?

+6
source share
2 answers

The TMUX_PANE environment TMUX_PANE is what you are looking for.

+12
source

There is also a pane_id format variable that expands to a unique identifier for the panel.

Usage example:

 $ tmux run "echo 'This is unique pane id: #{pane_id}'" 
+7
source

Source: https://habr.com/ru/post/973897/


All Articles