I want to replace status bar with bash prompt displaying window number like ①. How can I get current window number in the shell?
There's TMUX_PANE env variable, unfortunately no TMUX_WINDOW.
The closest I got is:
tmux display-message
to flash window/pane info, then take last line of tmux show-messages
and parse it. I don't want the window/pane info to flash each time the prompt is displayed.
Best Answer
You can use
display-message -p
to send the output to stdout to avoid having to extract it from the output ofshow-messages
:You could convert to the circled numbers like this (bash syntax; tested with versions 3.2.48 and 4.2.20):
The first line is nice in that it is pure ASCII; if you do not mind having non-ASCII characters in your configuration file, then you can go with the second line instead (it certainly makes the intent more obvious, assuming your editor and shell can properly handle the file’s encoding).
Then you could use it like this: