fix: select-pane -Z loses its -Z flag when used in bind-key#249
Conversation
|
Hey @LizardLiang, thank you so much for digging into this and sending such a clean, well scoped patch. I pulled the branch locally and walked through the change end to end:
Squashed and merged as f0b94c2 with you as the author so the credit stays with you. This will ship in the next release. Really appreciate the contribution and the thoughtful issue write up that came with it. Hope to see more from you. |
Thanks for the quick merge! I've been looking for a solid tmux alternative for a long time, and I'm really enjoying using this tool. Appreciate all your hard work on this project! |
|
Thank you for the contribution @LizardLiang . I'm really happy that you enjoy it. Share the word with your friends and colleagues! |
select-pane -Zis documented as supported (keep zoomed), but when it is used inbind-key, the stored binding gets rewritten into plain directionalselect-paneand loses the-Zbehavior.For example:
Repro
Expected
The binding should preserve the original command, e.g.
select-pane -Z -L
and pane switching should keep zoom.
Actual
The binding is rewritten into plain directional navigation, e.g.
select-pane -L
so the zoom-preserving behavior is lost before runtime.
Likely cause
bind-key appears to normalize commands into simplified internal actions too aggressively.
That works for exact commands like:
select-pane -L
but not for commands where extra flags change semantics, such as:
select-pane -Z -L
Proposed fix
When a key binding is parsed, only convert it into a simplified internal action if the command is an exact match.
For example:
So if a binding includes extra flags that matter, the original command should be kept as-is instead of being rewritten into the simpler directional action.
In short: