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

[tmux module] Auto-start Only creates default session if none created in tmux.conf #575

Conversation

xcambar
Copy link
Contributor

@xcambar xcambar commented Mar 12, 2014

(refs #544) As per @nasenatmer remark

@sorin-ionescu
Copy link
Owner

Is the second start-server needed?

@xcambar
Copy link
Contributor Author

xcambar commented Mar 12, 2014

tmux kills the server if no session. We must restart it if tmux.conf doesn't create any. So yeah, it's required.

See this comment #544 (comment) and the discussion around it for details.

@nasenatmer
Copy link
Contributor

👍 !

I use this code and it is definitely superior to the current setup (which I criticised in #544 (comment)) as I now end up with only my custom session (if defined in tmux.conf) and no additional prezto session being started. And if there's no session defined in tmux.conf, the prezto session is started and attached automatically.

@nasenatmer
Copy link
Contributor

Been using this for a few days now and it seems perfectly fine!

@xcambar
Copy link
Contributor Author

xcambar commented Mar 17, 2014

Glad to hear that. Thanks for the follow up.

@milkypostman
Copy link

i think you can remove the second "server-start" from within the if statement and will achieve the same thing.

@xcambar
Copy link
Contributor Author

xcambar commented Mar 26, 2014

Unfortunately not. By design, tmux kills the server if there's no active session.

The point of this is to handle the case where your tmux.conf creates sessions. In this case, you won't need to default prezto session.

@milkypostman
Copy link

new-session implies start-server, the call to start-server here https://github.com/xcambar/prezto/blob/prevent_default_session_if_any_at_startup/modules/tmux/init.zsh#L31 is not necessary.

i just tested this and it does work just fine.

@xcambar
Copy link
Contributor Author

xcambar commented Mar 26, 2014

Agreed. Updated.

@sorin-ionescu
Copy link
Owner

Merged via ff0dfa4.

@xcambar xcambar deleted the prevent_default_session_if_any_at_startup branch April 4, 2014 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants