-
Notifications
You must be signed in to change notification settings - Fork 233
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
tmuxp pass args to tmux #171
Comments
I need to know what behavior you're looking to get to be sure. I believe I can add a |
This is the integration I'd like to make use of, but it seems somewhat complicated. I don't know if it matters that it launches a new terminal to do this: |
not necessary, I can just create it with |
It would be nice to be able to pass flags to tmux on startup. I would like to use it for iTerm integration like @JBKahn. I think it is reasonable for tmuxp to allow it as one of its purposes is to make it easy to start and use sessions. |
Has anyone got this working?
|
The commands aren't pass-thru at of now, but I think it makes sense for us to use We recently introduced window appending, which overlaps with tmux's |
I added a pinned label so the cleanup bot won't close this |
Thanks @tony. I'm fairly new to tmux so still stumbling around in the dark quite a lot. Thought iTermocil might be better for iTerm but ironically it blows up when using its tmux integration. Found a comment proposing tmuxinator and a sample config. Can tmuxp be configured similarly, my impression is pass-thru commands would be required or did I misunderstand? |
I never heard of itermocil - and it's cool you bring it up I'd need to take a peek at it, but unfortunately I don't have a mac to try it with And... they use python, kind of interesting why they don't use tmuxp / libtmux. So if we have a mac user that can test, maybe it'd be possible for an integration to happen I think in the mean time if you want to use iTerm, you mean want to use teamocil / tmuxinator / etc in the meantime, unless someone else with macOS can step into help us (Any takers?) |
I found this thread trying to look for how to launch tmuxp passing argument to it; the way that you could in tmuxinator. But it seems like that is rather ruby-specific. In the mean time I guess I can just use environment variables. |
@leeand00 Do either of these help? https://tmuxp.git-pull.com/configuration/examples.html#environment-variable-replacing, https://tmuxp.git-pull.com/configuration/examples.html#environment-variables Assume session_name: ${SESSION_NAME}
windows:
- window_name: ${WINDOW_NAME}
panes:
- $ env SESSION_NAME='my session' WINDOW_NAME='a window' tmuxp load ./test_env_vars.yaml |
That works great except I can't pass any of the env cars to my shell cmds. |
@leeand00 That may be the case - not sure. It could be something we could add Can you give an example config file so I can try? |
echos Also it's not an available environment variable either within the shell that opens. |
I was able to do it here, slightly different syntax: session_name: ${SESSION_NAME}
windows:
- window_name: ${WINDOW_NAME}
panes:
- echo ${WINDOW_NAME} env SESSION_NAME='my session' WINDOW_NAME='a window' tmuxp load ./test_env_vars.yaml That work? |
Also I was able to do it with this too: session_name: ${SESSION_NAME}
windows:
- window_name: ${WINDOW_NAME}
panes:
- shell_command:
- echo ${WINDOW_NAME}
What command are you running? |
@leeand00 Forgot to tag you ^ |
|
@leeand00 This works for me. I think you can do it. Maybe there's a typo somewhere? Try on a new shell / terminal without other stuff running? (e.g. kill tmux and have a new terminal window)
|
tmuxp 1.5.4 tmuxp debug-info Error: No such command "debug-info". |
@leeand00 Where did you install tmuxp from? Current version is 1.13.1, here's the changelog since 1.5.4: https://github.com/tmux-python/tmuxp/blob/v1.13.1/CHANGES Any chance you can update? |
@tony from apt-get WSL2, Ubuntu 20.04 LTS Is there a dpkg? Or pip? |
Think you could try to use pipx to get a more recent What shell are you using? Bash? zsh? fish? dash? |
@tony Okay I installed pipx 0.12.3.1. The command for installation I found on the main page doesn't appear to work (for me at least)
|
@leeand00 Hmm. It seems
~/.local/bin/tmuxp Does that work? You may need to add if [ -d "$HOME/.local/bin" ]
then
export PATH=$PATH:$HOME/.local/bin
fi In lieu of all the above: I think it depends what fits your style. I would encourage searching online for whichever angle you would like to get caught up with My only hesitation is, if I sent more commands on their own, I'm afraid it could bork your python installation. It may be a prerequisite to familiarize |
Tmuxinator can pass args to
I thought Tmuxp could do this just as well as Tmuxinator. Am I mistaken about the method for this? Related: #867 |
Is there a way (can't find any) to pass an arbitrary arg to tmux? I want to pass
-CC
but I don't see an easy way to do that and I'm not familiar with the packages you're using so I'm not sure where in the code this would have to be.The text was updated successfully, but these errors were encountered: