-
Notifications
You must be signed in to change notification settings - Fork 109
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
How to run commands without starting shell #34
Comments
Tmuxifier doesn't currently allow passing custom arguments to the new-window command: https://github.com/jimeh/tmuxifier/blob/master/lib/layout-helpers.sh#L20-L27 I am planning to add support for it though, just haven't gotten there yet. In the meantime what you can do is instead of calling the tmuxifier-tmux new-window -t "$session:" -d -n "host" "ssh host" |
Thanks 👍 |
Is it pure sh syntax? Could I write a sh for loop and cycle through? |
Yepp, the layouts files are just pure bash scripts with some helper functions made available by Tmuxifier :) |
The layout files are literally just sourced with |
Great, thanks again! |
Hmm interesting. If I use this at the end of my window-file:
I get what I expect - the nine windows, each ssh:ed into it's respective host. However, if I instead use a loop:
I get this:
and it seems that it creates the session and the first window (localhost), defined by the default
earlier in the file Could you perhaps shed som light on this? Is it a timing issue? The loop is too quick? |
Hmm, tested to rename the session to have a different name than the window-layout - no more error... |
Apparently it's not enough with a different name - it needs a dash '-' in the name to not give the error. Strange. |
I think it could be due to tmuxifier-tmux new-window -t "${session-$(tmuxifier current-session)}:" -d -n "host1" "ssh host1" Basically if |
👍 Thanks, that did the trick! |
Is there a way to send commands to tmux without having to start the shell and sending the command there?
In my old script (used before finding tmuxifier) I have:
which makes tmux name the window after the remote host and execute ssh directly, without first executing my login shell.
How do I achieve the same result from a tmuxifier config?
The text was updated successfully, but these errors were encountered: