4

In a bash script, I want to get the count of windows in current tmux session.

I found tmux display-message -p '#I' get count of pane in current window. But how can I get count of windows instead?

1 Answer 1

4

#I is not the number of panes in the window, it is the pane index - for number of panes you want '#{window_panes}'.

Similarly, for number of windows in a session you can do '#{session_windows}'.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.