Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get the active pane ID for tmux panes

Tags:

bash

tmux

I'm writing a bash script that loops through all the panes I have open and executes several send-keys commands. Except I want to apply some different logic for the pane I'm executing this script in to prevent send-keys from interrupting the script.

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

like image 614
eswidler Avatar asked Aug 16 '14 12:08

eswidler


People also ask

How do I change the pane name in tmux?

Inside tmux pane, press Ctrl+B < , enter the title of your choice, and pane title will be set.

How do I find a session in tmux?

To enter command mode, type prefix>: followed by list-sessions or ls to view a list of currently active Tmux sessions. By default, list-sessions are bound to the prefix> s key combination. With j and k, you may explore the session list and activate one by hitting enter.


1 Answers

The TMUX_PANE environment variable is what you are looking for.

like image 159
chepner Avatar answered Oct 26 '22 07:10

chepner