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

not renaming when starting tmux #36

Closed
Morette opened this issue Apr 3, 2024 · 1 comment
Closed

not renaming when starting tmux #36

Morette opened this issue Apr 3, 2024 · 1 comment

Comments

@Morette
Copy link

Morette commented Apr 3, 2024

plugin is not renaming pane when tmux is starting, I need to create another pane and switch

this is the log right after entering tmux
tmux version: 3.4

➜ cat /tmp/tmux-window-name
DEBUG - rename_session_windows.py:328 main() Args: Namespace(print_programs=False, enable_rename_hook=True, disable_rename_hook=False, post_restore=False)
DEBUG - rename_session_windows.py:329 main() Options: Options(shells=['bash', 'fish', 'sh', 'zsh'], dir_programs=['nvim', 'vim', 'vi', 'git'], ignored_programs=[], max_name_len=20, use_tilde=False, substitute_sets=[('.+ipython([32])', 'ipython\\g<1>'), ('^(/usr)?/bin/(.+)', '\\g<2>'), ('(bash) (.+)/(.+[ $])(.+)', '\\g<3>\\g<4>')], dir_substitute_sets=[], show_program_args=True, log_level='DEBUG')
DEBUG - rename_session_windows.py:328 main() Args: Namespace(print_programs=False, enable_rename_hook=True, disable_rename_hook=False, post_restore=False)
DEBUG - rename_session_windows.py:329 main() Options: Options(shells=['bash', 'fish', 'sh', 'zsh'], dir_programs=['nvim', 'vim', 'vi', 'git'], ignored_programs=[], max_name_len=20, use_tilde=False, substitute_sets=[('.+ipython([32])', 'ipython\\g<1>'), ('^(/usr)?/bin/(.+)', '\\g<2>'), ('(bash) (.+)/(.+[ $])(.+)', '\\g<3>\\g<4>')], dir_substitute_sets=[], show_program_args=True, log_level='DEBUG')

and after creating another pane and doing switch

➜ cat /tmp/tmux-window-name
DEBUG - rename_session_windows.py:328 main() Args: Namespace(print_programs=False, enable_rename_hook=True, disable_rename_hook=False, post_restore=False)
DEBUG - rename_session_windows.py:329 main() Options: Options(shells=['bash', 'fish', 'sh', 'zsh'], dir_programs=['nvim', 'vim', 'vi', 'git'], ignored_programs=[], max_name_len=20, use_tilde=False, substitute_sets=[('.+ipython([32])', 'ipython\\g<1>'), ('^(/usr)?/bin/(.+)', '\\g<2>'), ('(bash) (.+)/(.+[ $])(.+)', '\\g<3>\\g<4>')], dir_substitute_sets=[], show_program_args=True, log_level='DEBUG')
DEBUG - rename_session_windows.py:328 main() Args: Namespace(print_programs=False, enable_rename_hook=True, disable_rename_hook=False, post_restore=False)
DEBUG - rename_session_windows.py:329 main() Options: Options(shells=['bash', 'fish', 'sh', 'zsh'], dir_programs=['nvim', 'vim', 'vi', 'git'], ignored_programs=[], max_name_len=20, use_tilde=False, substitute_sets=[('.+ipython([32])', 'ipython\\g<1>'), ('^(/usr)?/bin/(.+)', '\\g<2>'), ('(bash) (.+)/(.+[ $])(.+)', '\\g<3>\\g<4>')], dir_substitute_sets=[], show_program_args=True, log_level='DEBUG')
DEBUG - rename_session_windows.py:328 main() Args: Namespace(print_programs=False, enable_rename_hook=False, disable_rename_hook=False, post_restore=False)
DEBUG - rename_session_windows.py:329 main() Options: Options(shells=['bash', 'fish', 'sh', 'zsh'], dir_programs=['nvim', 'vim', 'vi', 'git'], ignored_programs=[], max_name_len=20, use_tilde=False, substitute_sets=[('.+ipython([32])', 'ipython\\g<1>'), ('^(/usr)?/bin/(.+)', '\\g<2>'), ('(bash) (.+)/(.+[ $])(.+)', '\\g<3>\\g<4>')], dir_substitute_sets=[], show_program_args=True, log_level='DEBUG')
DEBUG - rename_session_windows.py:236 rename_windows() panes_with_programs=[]
DEBUG - rename_session_windows.py:237 rename_windows() panes_with_dir=[Pane(info=Pane(%0 Window(@0 1:zsh, Session($0 main))), program=None), Pane(info=Pane(%1 Window(@1 2:zsh, Session($0 main))), program=None)]
DEBUG - rename_session_windows.py:257 rename_windows() get_exclusive_paths result, input: panes_with_dir=[Pane(info=Pane(%0 Window(@0 1:zsh, Session($0 main))), program=None), Pane(info=Pane(%1 Window(@1 2:zsh, Session($0 main))), program=None)], output: exclusive_paths=[(Pane(info=Pane(%0 Window(@0 1:zsh, Session($0 main))), program=None), PosixPath('thiago')), (Pane(info=Pane(%1 Window(@1 2:zsh, Session($0 main))), program=None), PosixPath('thiago'))]
DEBUG - rename_session_windows.py:265 rename_windows() processing exclusive_path: display_path=thiago p.program=None
DEBUG - rename_session_windows.py:291 substitute_name() substituting thiago
DEBUG - rename_session_windows.py:205 rename_window() renaming window_id=@0 to window_name=thiago
DEBUG - rename_session_windows.py:208 rename_window() shortened name window_name=thiago
DEBUG - rename_session_windows.py:265 rename_windows() processing exclusive_path: display_path=thiago p.program=None
DEBUG - rename_session_windows.py:291 substitute_name() substituting thiago
DEBUG - rename_session_windows.py:205 rename_window() renaming window_id=@1 to window_name=thiago
DEBUG - rename_session_windows.py:208 rename_window() shortened name window_name=thiago
@ShelpAm
Copy link
Contributor

ShelpAm commented Jan 21, 2025

This is intended behaviour. The plugin won't rename window(s) for you when starting up.

But if you'd like to ask it to rename for you, you can set this in your tmux.conf:

# Run the script when any window is created
set-hook -g after-new-window 'run-shell "/path/to/your/tmux-window-name/scripts/rename_session_windows.py"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants