Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHow can I set the session_name dynamically based on the current directory? #634
Comments
|
Without any extra elaborate thoughts envsubst could be used along with bash process substitution : And its supported natively ... |
|
@sluther-electro Unfortunately, I don't see a way that the session name can be dynamically set in the current release of tmuxp (1.5.6). However, version 1.6.0 is in the works and is about ready to be released and it includes a plugin system that provides hooks into the libtmux objects, the session object being one of those. Renaming the session could be supported through a plugin. Let me know if you are interested in getting a jump start on developing a plugin and I can send over screenshots/html of the documentation for the Plugin System of version 1.6.0. To get a sneak peek, you could go take a look at the changes being worked on here: https://github.com/joseph-flinn/tmuxp/tree/plugin-system. |
I've created a shared tmux config in ~/.tmuxp/org.yml. I'd like to set the session_name dynamically based on the directory I'm launching tmux from using a shared config file.
I.e. if my path is
/Users/sluther/Projects/org/project_1and I usetmuxp load orgto start tmux, I want thesession_nameto be set toproject_1. I've tried the following:Here's my
before-org.shscriptAnd here's my
org.ymlfile:Is there any way to make this work?