Closed kohane27 closed 2 years ago
Thanks for the detailed issue.
I would add @tmux_window_substitute
which allows to add regex replace with list of tuples.
By the way I would suggest to turn off update_tmux_title
in ranger, it modifies your tmux rename options, it collides with tmux-window-name
Thank you so much for such a quick fix enhancement. Really appreciate it. It works like a charm! Btw this is what I get after running --print_programs
for ranger:
❯ ~/.tmux/plugins/tmux-window-name/scripts/rename_session_windows.py --print_programs
/usr/bin/python -O /usr/bin/ranger -> ranger
Thanks again!
Not sure if this is relevant but I think it might be helpful to some people.
I use ranger along with tmux
a lot. When I open ranger
, and then open a file in vim
, the tmux pane is stuck with the name ranger
, which is not helpful. I have the following vim snippet to rename the tmux
pane whenever I open a file in vim.
augroup _tmux_rename
autocmd!
if exists('$TMUX')
autocmd BufReadPost,FileReadPost,BufNewFile,BufEnter * call system("tmux rename-window " . expand("%:t"))
endif
augroup end
We don't need the following
autocmd VimLeave,FocusLost * call system("tmux rename-window \"\"") " to enable auto-rename again
because tmux-window-name
takes care for us when we're back to ranger
. Cheers!
Hello ofirgall!
First, thank you for creating such a useful program. Really happy that I no longer need to manually rename windows.
However, I have a problem with it integrating with ranger. Please see the video below:
https://user-images.githubusercontent.com/57322459/162747412-03e085f4-2304-4167-b5e3-b9f03f07882e.mp4
To reproduce:
r
(my alias for ranger) to open ranger in terminalalt+2
/usr/bin/python -O /
Below is my settings in ranger (if it's relevant):
I've tried disabling
tmux-window-name
as follows:This is what happens:
https://user-images.githubusercontent.com/57322459/162747571-ccf76c48-da9b-43ea-9999-8e28091369c2.mp4
It's simply displayed as
python
(better than/usr/bin/python -O /
imo)However, I simply lose the benefits of using
tmux-window-name
:Recommendation
Maybe provide a manual intervention to rename certain programs? Currently I encounter this problem only with ranger. But I'm quite sure there are other programs with similar issues. Is it possible to provide a way to "override manually"? Like a mapping below:
Thank you again!