preservim / vimux

easily interact with tmux from vim
MIT License
2.21k stars 161 forks source link

Tmux 3.1 deprecated the `-p` flag #220

Closed jez closed 7 months ago

jez commented 1 year ago

Using the -p flag on split-window to say that the new splits size is a certain percentage has been deleted in 3.1, and will produce a Size missing error when you try to call split-window. The replacement is that the existing -l flag can either take an exact number of lines (or columns if making a vertical split) specified like -l 10 or a percentage, specified using a percent sign like -l 20%, which means the same as the old -p 20.

Relevant links:

I only use tmux version 3.1 or later on my personal machines, so I have simply patched this plugin locally to always use -l ...% instead of -p ....

I leave it up to the maintainers of this project how to proceed with a proper fix. Either change the code to use -l 10% (which won't work on older versions of tmux, and thus might break existing Vimux users), or do some sort of version/feature detection to attempt to allow using Vimux with both old and new versions of tmux.

As always, thanks for the work on this project.

mvanderkamp commented 1 year ago

Related: #217

mvanderkamp commented 1 year ago

I think version detection would be appropriate, but that does open a can of worms since tmux is constantly changing features. The alternative is to say "sorry- try this tag of the plugin" to users with older versions of tmux. Perhaps version checking with a deprecation message?

jez commented 1 year ago

Another option would be a global option that stores the tmux command and/or flags used to open the split, which defaults to the flags required by the latest tmux version but can be overridden for users who want to use older versions.

In any case I defer to you! Again I’m already happy with my solution of editing the files directly in the mean time.

ianchesal commented 7 months ago

The latest release of tmux appears to have completely dropped support for -p and this plugin is no longer functional as a result.

I can confirm the fix in #217 restores the plugin's functionality when using tmux 3.4.

mvanderkamp commented 7 months ago

I wonder if that's deliberate, it looks like it's still supported, if I'm reading the code right: https://github.com/tmux/tmux/blob/608d113486835515e7a89b1511704440c68ae817/cmd-split-window.c#L97

That said, it looks like -l has been around for at least 15 years, at least since tmux has been tracked in git, possibly longer: https://github.com/tmux/tmux/blame/fc6a65c6207dbefcd8b5f187148978f8d4111b2b/cmd-split-window.c#L91

I vote we just use -l.

alerque commented 7 months ago

Closed via #217.