omerxx / tmux-sessionx

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

fix(reload_sessions): fixed sessions reloading bug, if there is only … #23

Closed RobinRuf closed 9 months ago

RobinRuf commented 9 months ago

…one session left after deleting

If there is just one session left right after deleting another, an ugly error message appears and the remaining session will not reload properly without reopening sessionx. (Tested on OSX Sonoma 14.1.1)

Screenshot 2023-12-30 at 14 55 51

RobinRuf commented 9 months ago

Sorry, I do not really understand, why it shows that many changes in sessionx.sh, I just changed 1 line and added the reload_sessions.sh file.

- BIND_ALT_BSPACE="alt-bspace:execute(tmux kill-session -t {})+reload(tmux list-sessions | sed -E 's/:.*$//' | grep -v $(tmux display-message -p '#S'))"
+ BIND_ALT_BSPACE="alt-bspace:execute-silent(tmux kill-session -t {})+reload(${TMUX_PLUGIN_MANAGER_PATH%/}/tmux-sessionx/scripts/reload_sessions.sh)"

@omerxx

omerxx commented 9 months ago

Thanks! Looking into it

omerxx commented 9 months ago

@RobinRuf That's great, I'd love to merge if you could eliminate the formatting changes, otherwise I'll manually cherry pick the changes

RobinRuf commented 9 months ago

I synced my fork with the latest version of the main branch (because of the latest merge a few hours ago)

I did the same thing without formatting changes and for the latest version in #28 , so please take a look and then you can merge it :)