ofirgall / tmux-window-name

A plugin to name your tmux windows smartly.
MIT License
213 stars 22 forks source link

Error message `window failed: index in use` when using with tmux-tilish #8

Closed kohane27 closed 2 years ago

kohane27 commented 2 years ago

Hello ofirgall!

Hope you're doing well. I've found a problem when using tmux-window-name with jabirali/tmux-tilish. Please see the following video:

https://user-images.githubusercontent.com/57322459/162862968-d428c38a-ce2b-464f-8fc0-88c2b7bd90e9.mp4

  1. Switch to window 2 with shortcut Alt+2 (works as expected)
  2. Switch to window 1 with shortcut Alt+1 (works as expected)
  3. In window 1 open vim
  4. Switch to window 2 again with shortcut Alt+2
  5. Error message Create window failed: index 2 in use (but I can indeed switch to window 2; tmux just focuses on the error message)
  6. Switch to window 1 again and the same error message appeared

Here's the dir tree from the video:

.
├── feature
│   └── index.html
└── feature2
    └── index.html

It's not just opening vim. For any window, whenever I leave the terminal by using any programs (Vim, ranger, fzf), the same error message appears. Please see the following video again:

https://user-images.githubusercontent.com/57322459/162863180-b705dfb0-918e-41d3-86d3-45eea211be02.mp4

  1. Spawn 4 windows
  2. Cycle through them (works as expected)
  3. Open vim in window 4
  4. Cycle through windows trigger the error message (but the switching window function passed through)
  5. Quit vim in window 4
  6. Cycle through windows again and no error message (works as expected)

Whenever all windows stay in the terminal, no error message. Whenever I open a program in any window, the error message appears. The error message is from tmux-window-name because I tried disabling it, and no error message occurred.

Any help is much appreciated. Thank you!

ofirgall commented 2 years ago

Hey, tmux-window-name doesn't create windows, it only renames them, the error message is from tmux itself.

I will later take a quick look if tmux-window-name can do something about it but I seems like a tmux-tilish issue.

ofirgall commented 2 years ago

What tmux version do you use? Can you share the output of tmux show-hooks -g?

kohane27 commented 2 years ago

Greeting ofirgall. Thank you for getting back to me again on such short notice. I appreciate it.

I'm on tmux 3.2a.

I'll look into this issue further and report any useful finding. In the meantime, here's the output from tmux show-hooks -g:

❯ tmux show-hooks -g
after-bind-key
after-capture-pane
after-copy-mode
after-display-message
after-display-panes
after-kill-pane
after-list-buffers
after-list-clients
after-list-keys
after-list-panes
after-list-sessions
after-list-windows
after-load-buffer
after-lock-server
after-new-session
after-new-window
after-paste-buffer
after-pipe-pane
after-queue
after-refresh-client
after-rename-session
after-rename-window
after-resize-pane
after-resize-window
after-save-buffer
after-select-layout
after-select-pane
after-select-window[8921] run-shell /home/user/.tmux/plugins/tmux-window-name/scripts/rename_session_windows.py
after-send-keys
after-set-buffer
after-set-environment
after-set-hook
after-set-option
after-show-environment
after-show-messages
after-show-options
after-split-window[0] select-layout ; select-layout -E
after-unbind-key
alert-activity
alert-bell
alert-silence
client-attached
client-detached
client-resized
client-session-changed
session-closed
session-created
session-renamed
session-window-changed
ofirgall commented 2 years ago

I can't recreate the issue on my system. I have looked through tmux-tilish, it doesn't create windows either.

Have you tried to run /home/user/.tmux/plugins/tmux-window-name/scripts/rename_session_windows.py from the terminal? does it create the same tmux error?

ofirgall commented 2 years ago

Closed due inactivity

kohane27 commented 2 years ago

Hello @ofirgall

I'm very sorry for not responding 2 months ago.

Thank you for maintaining this program:) After seeing your new commits I decided to take another stab at it today. I'm very happy to report that this bug is gone! I have no idea why but I could no longer reproduce the same error msg. Here's the same video from above:

https://user-images.githubusercontent.com/57322459/173162334-1fc6404f-0a31-4de8-aa5b-edec364e28f4.mp4

Maybe it's the tmux update (tmux 3.2a); maybe I'm now loading tmux-window-name before tmux-resurrect. Regardless thank you again! I'm very happy to be enjoying your program again:)