omerxx / tmux-sessionx

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

Window mode not working when the windows are unnamed/have the same name #13

Closed av1155 closed 7 months ago

av1155 commented 7 months ago

Window mode does not show the preview of windows if the window has no name (windows have no name by default when created [default 1, 2, 3, etc values do not work]), it also does not switch to the windows (again, if they have no name). Everything else works as expected, previews do show up for sessions, as expected.

When pressing C-w the command works because it expands the session into three to show the three currently active windows for that session; however, it does not show a preview or switch to the selected window of that session (if the window has no name [default 1, 2, 3, etc values do not work]).

Configuration for SessionX:

Screenshot 2023-12-13 at 2 57 46 PM

Step 1: Open the menu without window mode (window mode is off):

Screenshot 2023-12-13 at 3 02 14 PM

Step 2: When manually triggering window mode with C-w it expands the session into the three currently active windows for that session:

Screenshot 2023-12-13 at 3 02 28 PM

Step 3: Cycling through the three windows does not show any preview:

Screenshot 2023-12-13 at 3 02 31 PM Screenshot 2023-12-13 at 3 02 33 PM

Step 4: Dotfiles session does show preview, and when selected it goes into the session as expected.

Screenshot 2023-12-13 at 3 02 36 PM
omerxx commented 7 months ago

Indeed an issue. I think most users don't get this as new windows will be configured to use a default name like the default process or another config.

That said, I did reproduce and will look into using IDs rather than names. Thanks!

Edit: on a second thought I think this may point to a broader issue of duplications when windows are either named the same (e.g. default zsh process or by the user)

av1155 commented 7 months ago

If I rename all windows with the same Nerd Font window icon as a name (automatically, as seen on my Tmux config), the window preview does not work. As pointed out in the original issue, it also does not work as expected when the windows have no names.

Screenshot 2023-12-14 at 11 58 39 AM

Here you can see the issue in action:

Screenshot 2023-12-14 at 12 03 58 PM Screenshot 2023-12-14 at 12 04 05 PM Screenshot 2023-12-14 at 12 04 08 PM Screenshot 2023-12-14 at 12 04 30 PM

After renaming the windows to have different names:

Screenshot 2023-12-14 at 12 05 10 PM Screenshot 2023-12-14 at 12 05 12 PM Screenshot 2023-12-14 at 12 05 14 PM Screenshot 2023-12-14 at 12 05 15 PM

Thanks! I enjoy this plugin.

omerxx commented 7 months ago

Got it! Thanks!

omerxx commented 7 months ago

@av1155 pushed a fix that addresses windows index rather than names. This works. The problem I think is that winodw names are many times used for describing the workspace with logical names and this takes it away. I'll think of a way to improve the experience