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

sessions invisible after kill-session from switcher #72

Open
pandalanax opened this issue Apr 5, 2024 · 8 comments · May be fixed by #98
Open

sessions invisible after kill-session from switcher #72

pandalanax opened this issue Apr 5, 2024 · 8 comments · May be fixed by #98
Labels
bug Something isn't working

Comments

@pandalanax
Copy link

Deleting a session makes other sessions invisible.
Example:
I have four sessions running.
image

Now deleting test2 session leads to this:
image

Reopening the session view is listing all sessions again:

image

Tmux Version: 3.3a
tmux-sessionx running on e6d0215
nixOS 23.11

@omerxx
Copy link
Owner

omerxx commented Apr 5, 2024

Yep, what's happening here is you killing the current session "test2", tmux puts you on the next one on the list "test1" and sessionx reverting to its default of filtering out the current session from the list.

Note to self: KILL_SESSION invokes reload_sessions.sh where the code should take user configuration into consideration

@omerxx omerxx added the bug Something isn't working label Apr 5, 2024
@pandalanax
Copy link
Author

mh, in the screenshots my current session is "nix". But if i am in "test2" and kill it, the behavior you described is correct.
I have set-option -g detach-on-destroy off set in my tmux.conf

@sarojregmi200
Copy link
Contributor

@omerxx, I got what you said. And was thinking about opening an issue regarding this problem.

set -g @sessionx-filter-current 'false'

Works as configured, and when any one of the session is deleted it removes the session but ignores the above configuration and hides the session that is currently active.

Thanks for the note above as it cleared me where to look for the problem.

if [[ $(echo "$SESSIONS" | wc -l) -gt 1 ]]; then
	echo "$SESSIONS" | grep -v "$CURRENT_SESSION"
else
	echo "$SESSIONS"
fi

Here the configuration check is missing, I would love to look at it.
I think this issue has been open for long.

@sarojregmi200
Copy link
Contributor

@omerxx Just a gentle reminder. What are your thoughts on this?
I think you missed the above mention.

omerxx added a commit that referenced this issue May 18, 2024
sessions. This should fix #72 so that the current session isn't filtered
if set so in the config.
@omerxx omerxx linked a pull request May 18, 2024 that will close this issue
@omerxx
Copy link
Owner

omerxx commented May 18, 2024

@sarojregmi200 Sorry for the delay, pushed a branch held in a PR (#98), this should solve the issue.
Would you like to quickly test it by installing the plugin from that branch?

set -g @plugin 'omerxx/tmux-sessionx#72-kill-and-filter'

@sarojregmi200
Copy link
Contributor

I will once I am free.

And would like to see your approach, I have already patched my cloned version.

@omerxx
Copy link
Owner

omerxx commented May 19, 2024

I will once I am free.

And would like to see your approach, I have already patched my cloned version.

@sarojregmi200 It's just the same statement used on the main .sh file.
Since fzf's execute requires an executable to run, I had to separate reload-sessions.sh form the main plugin, creating a duplication. A more elegant approach would be another utils file that I could source on both cases but for now this should be enough

@sarojregmi200
Copy link
Contributor

Yeah! I was also thinking the same looking at the changed files. And am yet to test it but I think there are some more configurations that should be duplicated to ensure user's customization takes effect.
Let me confirm my guess and report it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants