Closed Farzat07 closed 3 years ago
Fixes #57. Fixes #343.
As mentioned in #222 we need a a right fix for this feature. Tmux's behavior around automatic-rename
is unfortunately somewhat complex.
Ok now I will tell you what I understand about the functionality and my plans for the new implementation, so please correct me if I am missing something.
The local auto-rename option can have one of three values:
The tmux format query #{?automatic-rename,on,off} returns only on or off. If the option is unset, the value of the global option is returned. This is the applies to both my implementation and The implementation in #222.
Ideally, one should keep the local option unset if that was initially the case. Actually that was my plan at the start, but I didn't implement it because I thought that the use case for this (changing the global option halfway through a session while the local options are unset) is not really meaningful (I can explain why but I guess this is not the place for that).
However, you are right. Even if I believe that this use case is not meaningful does not mean someone else won't find it useful. Handling that now would be better than doing it later.
Again if I am missing something, please let me know.
I implemented the new ideas in #401.
Will close this PR.
When windows are renamed while restoring tmux, the value of automatic-rename is set to off, which might not be desired.
Therefore, the original value of the automatic-rename option for each window is now saved and set again while restoring. This means that windows intended to have fixed names will continue to have fixed names, while windows intended to have automatic-rename will continue to have automatic-rename.