omerxx / tmux-sessionx

A Tmux session manager, with preview, fuzzy finding, and MORE
GNU General Public License v3.0
556 stars 51 forks source link

latest changes from PR #57 break tmux-sessionx again. #67

Closed mayersj1 closed 3 months ago

mayersj1 commented 3 months ago

After the latest commit of tmux-sessionx, attempting to switch between sessions in the sessionx window is broken again. Attempting to switch to any session results in the following error:

'/Users/smayer/.tmux/plugins/tmux-sessionx/scripts/sessionx.sh' returned 1 and another session is created rather than switching to the one that was selected.

Andreasgdp commented 3 months ago

I've been getting this error as well.

omerxx commented 3 months ago

I just updated to the latest and not seeing this, is this still happening? @ProgmRuanSilva Are you seeing this as well?

infinite-ops commented 3 months ago

I have the issue too, it seems to be from around the changes to do with not removing spaces in session names. I've gone back to 66d340e where things work.

omerxx commented 3 months ago

@ProgmRuanSilva @yakloinsteak Can you guys have a look and see whether this reproduces / whether something's wrong and needs reverting?

yakloinsteak commented 3 months ago

Could the people on this thread share their OS and the version of sed from sed --version? I have a suspicion it's related to one of those things (particularly using the stock sed on a Mac). I'm running Ubuntu 22 with GNU sed 4.8, and I'll try to get my hands on a Mac tomorrow to test out my hunch.

infinite-ops commented 3 months ago

fedora 39 sed 4.8-14

yakloinsteak commented 3 months ago

Thanks, @infinite-ops . Would you mind sharing the sessionx part of your .tmux.conf file, and could you provide the path you selected and the name/path of the session that it incorrectly takes you to?

infinite-ops commented 3 months ago

hi @yakloinsteak

set -g @plugin 'omerxx/tmux-sessionx'
set -g @sessionx-window-mode 'on'
set -g @sessionx-zoxide-mode 'on'
set -g @sessionx-bind-scroll-down 'alt-j'
set -g @sessionx-bind-scroll-up 'alt-k'

With latest it happens on anything. It seems to create a new session instead of matching an existing session. I'll search for neovim and it'll find it in the search list but hitting enter it creates a new session called neovim_1 and then complains

existing tmux with a session called neovim 2024-04-01_10-39

changing to main and prefix o and searching for neovim finds it I hit enter but it creates this neovim_1 session and complains 2024-04-01_10-34

So now I have two sessions 2024-04-01_10-38

infinite-ops commented 3 months ago

just on the off chance I hadnt completely closed tmux (I tend to always have it running) I started fresh with main and its the same behavior 2024-04-01_10-45

yakloinsteak commented 3 months ago

That's helpful information. I'll try to get a fix done tonight. Maybe we revert if I can't get to the bottom of it tonight, and it might have to do with having no alternate paths set.

Andreasgdp commented 3 months ago

Arch sed v.4.9

tmux.conf

set -g @plugin 'omerxx/tmux-sessionx'
set -g @sessionx-bind '^o'
set -g @sessionx-window-mode 'on'
yakloinsteak commented 3 months ago

This seems to occur when sessionx-window-mode is set to on. I definitely have enough information to fix this now that I can reproduce it myself.

yakloinsteak commented 3 months ago

I'll do a little more testing, but I believe my PR keeps spaces in session names and paths working while fixing the issue with window-mode being on. I'll make it non-draft within an hour unless I find some big problem with it.

infinite-ops commented 3 months ago

nice! just took 5c7d1bd for a spin and it solves the issues I had!

yakloinsteak commented 3 months ago

Great! There are still edge cases like paths with dots and colons, but I can't get it to break with what are probably normal conditions. I'll make it non-draft. Thanks for testing, @infinite-ops

omerxx commented 3 months ago

Thanks @yakloinsteak ! 🙏