-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a title to a pane #582
Comments
This does seem to be supported in tmux, as shown in this example, but it's unclear how to access this feature through tmuxinator. |
Do we want this feature, cause you are able to do it with some ENV variable magic and scripts checking in background and adjust the pane names accordingly! |
Having such feature in tmuxinator without some ENV magic is exactly the reason why I am using tmuxinator in the first place. |
👍 |
#586 would add support for this, but last I checked it wasn't working as expected. I'll try to revisit the PR this week, but it'd be great if you all could take a look and provide feedback. |
Add renamePane() func in ~/.zshenv first, then invoking it in yml file , can modify pane name but inconvenient osx: 10.13.6
|
Until this lands via #586 the desired behavior can be accomplished using the following:
... and ...
The result will be something similar to the following: |
I used your solution but it seems not to work in my environment: # /root/.config/tmuxinator/root.yml
name: root
root: ~/
# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used.
startup_window: System-NMON-1
# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used.
startup_pane: 1
tmux_options: -f ~/.tmux.conf
windows:
- System-NMON-1:
layout: eff6,237x63,0,0[237x31,0,0{84x31,0,0,0,76x31,85,0,2,75x31,162,0,3},237x21,0,32{115x21,0,32,1,121x21,116,32,5},237x9,0,54,4]
# Synchronize all panes of this window, can be enabled before or after the pane commands run.
# 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after'
#synchronize: after
panes:
- nmon
- nmon
- nmon
- nmon
- htop
-
- System-NMON-2:
layout: 83d2,237x63,0,0[237x38,0,0{71x38,0,0,1,82x38,72,0,7,82x38,155,0,8},237x18,0,39,9,237x5,0,58,10]
#synchronize: after
panes:
- htop
- nmon
- nmon
- nmon
-
- HTOP:
#layout: e846,237x63,0,0[237x55,0,0,11,237x7,0,56,12]
layout: tiled
panes:
- htop
- tail -f /root/messages
-
- SHELL:
-
- LOGS:
layout: even-vertical
panes:
- tmux set-option -p -t root:4.0 @custom_pane_title "Terraria Logs" && docker logs -f terraria_s1_max
- tmux set-option -p -t root:4.1 @custom_pane_title "TS 3 Server Logs" && docker logs -f ts3
- tmux set-option -p -t root:4.2 @custom_pane_title "Maria DB Logs" && docker logs -f mariadb
- tmux set-option -p -t root:4.3 @custom_pane_title "Spigot Server Logs" && docker logs -f spigot-server-test
- tmux set-option -p -t root:4.4 @custom_pane_title "Console" && ls Also there is a unwanted pane resize so that the defined layouts are ignored which is also a point, which I don't want ... any ideas? |
Did you update your tmux config file using the provided line? Is the rest of that line being reflected, just not the custom_pane_title bits? Which version of tmux are you using? I'd suggest opening a separate issue for any pane resizing problems. |
In my case I had tmux 2.6 and it failed, but I installed 3.1b and it works. |
@gustawdaniel I'd mentioned that in my example, but I've gone back and emphasized that point. |
Panes already can have a name: windows:
- main:
panes:
- main:
- htop
- runserver:
- serverscripts.sh can't these titles not be used as the pane title? |
@TTycho It can be done but it would require some work. See my comment above for the blueprint. I also implemented this behavior in a separate project, so if someone wanted something more concrete, they could reference this:
The major considerations when implementing this are that 1) it makes assumptions about the contents of tmux.conf and 2) it won't work in older versions of tmux (<=3, IIRC). |
This requires a variable to be set, right? I mend to suggest to take the pane_name from the yaml structure if the panes are named there. |
Yes, that's where the value would come from but all of the above would still need to be done in order to make use of it. Unfortunately, tmux doesn't make it as simple as just supplying a (static) name when creating the pane. |
My chosen solution is to define an alias for the printf command and set the tmux options from within the yml config.
Is there a nicer way to set tmux option in the yaml without having to add a tmux config file? |
That's all pretty clever, @TTycho.
I don't believe so.
I think the only way to achieve anything like this at the moment would be to use ERB.
Would produce:
|
I'm trying to run multiple panes containing
htop
being run throughssh
to different servers. My configuration looks like:And when I launch it from tmuxinator, it runs the commands just fine. However, it obscures the SSH title, making it nearly impossible to tell which pane corresponds to which server.
Is there any way to tell tmuxinator to add some sort of "label" or "title" to each pane so I know which is which? I've read through the docs, but I don't see this feature mentioned anywhere.
The text was updated successfully, but these errors were encountered: