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-sessionizer no client selected #32

Open
jrock2004 opened this issue Dec 9, 2022 · 2 comments
Open

tmux-sessionizer no client selected #32

jrock2004 opened this issue Dec 9, 2022 · 2 comments

Comments

@jrock2004
Copy link

jrock2004 commented Dec 9, 2022

Steps to Produce:

  • open a tmux session
  • dettach session using ctrl+a d
  • in terminal type tmux-sessionizer
  • select a different folder then the tmux session you just detacted

You get a message that no client is selected. If you do a tmux list-sessions you see that it actually created the session but for some reason it did not attach

If I am in a tmux session this issue does not come up.

@Odaym
Copy link

Odaym commented Dec 20, 2022

Correct

Do notice though that sessions are created in this case anyway, if you experience the above and then do tmux list-sessions you will see the session you wanted to navigate to was indeed created.

Another thing is that when you do tmux kill-server right after encountering the above and then run tmux-sessionizer after it, it works again.

Even if you exit the session, tmux-sessionizer will still work, the only time it will do the above is indeed when detaching from a session and then attempting it again. Just confirming here.

@Odaym
Copy link

Odaym commented Dec 20, 2022

Actually I solved this, so you know how the very last line of the script had tmux switch-client -t $selected_name ?

It should have this instead:

if [[ -z $TMUX ]]; then
    tmux attach-session -t $selected_name
else
    tmux switch-client -t $selected_name
fi

Now if you kill server or detach or kill session or whatever, running tmux-sessionizer from the terminal will always land you in a new tmux session with the directory name as a name.

silasiebert added a commit to silasiebert/.dotfiles that referenced this issue May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants