★ wanayoo — archive 1999 https://github.com/tmux-python/tmuxp/issues/86Nouvelle recherche | Portail wanayoo
Skip to content
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

Allow windows to start up with command #86

Closed
WiggleWizard opened this issue Sep 5, 2014 · 3 comments
Closed

Allow windows to start up with command #86

WiggleWizard opened this issue Sep 5, 2014 · 3 comments
Labels

Comments

@WiggleWizard
Copy link

@WiggleWizard WiggleWizard commented Sep 5, 2014

Been fiddling with tmuxp and I am super impressed with it as I am transferring some legacy Bash scripts to Python for ease of maintenance however I cannot find how to start a window with a command?

Basically I have this line in my script: tmux -S $SOCKET_PATH new-window -dk -n "$WINDOW_NAME" -t "$SESSION_NAME":"$WINDOW_NAME" "$command"
Where when the window starts, it is created for the sole purpose of the $command.

I have tried out Pane.send_keys() function and yes this works really well but it doesn't have the desired effect where if I am executing a long running application and the application crashes the window/pane won't close and will stay in Bash.

@rpodgorny
Copy link

@rpodgorny rpodgorny commented Dec 3, 2014

this is a must-have!

until then, this hack works for me:

w = sess.new_window(attach=False)
w.tmux('respawn-pane', '-k', cmd)

@tony
Copy link
Member

@tony tony commented Dec 4, 2014

@Zinglish, @rpodgorny so the builder should have the pane / window launched with the command instead of sending keys afterwards. There was an issue with this across tmux versions, which is why I didn't include it.

This is a top-tier priority however because send_keys isn't efficient. If one of you get to this before hand, let me know. I will get to trialing this when time opens up over the next few weeks. FYI lower tmux versions may still need to degrade back to normal send_keys.

Thankfully the integration tests against multiple tmux versions.

@stale
Copy link

@stale stale bot commented Nov 11, 2017

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.

This bot is used to handle issues where the issue hasn't been discussed or
has gone out of date. If an issue isn't resolved and handled in a certain
period of time, it may be closed. If you would like your issue re-opened,
please create a fresh issue with the latest, up to date information and
mention this issue in it.

@stale stale bot added the stale label Nov 11, 2017
@stale stale bot closed this Nov 19, 2017
@jby jby mentioned this issue Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.