budimanjojo / tmux.fish

Tmux plugin for fish shell
MIT License
63 stars 11 forks source link

BREAKING: Change default behavior of this plugin #12

Closed budimanjojo closed 1 month ago

budimanjojo commented 1 month ago

I was using zellij instead of tmux for some time now and now I want to switch back to tmux so naturally I need this plugin again. And I found some problem with this plugin (it was a long time ago and maybe my knowledge has improved now I hope):

  1. It's a bad design in fish to get the behavior or $fish_tmux_autostart set to true. Because fish will always load everything inside $__fish_config_dir/conf.d directory before loading config.fish. This means this plugin will run before fish evaluate the user config file. So to change the default behavior of this plugin you'll need to set universal variable, then restart the plugin for it to take effect. This is also why problem such as #4 happened. User should be able to control when to start tmux in their config.fish. I'm thinking about removing $fish_tmux_autostart and let user control it instead just like how zellij does. This is a breaking change.
  2. There are some new features in the upstream that I haven't include here, one of them is having $fish_tmux_config should defaults to $HOME/.tmux.conf and $XDG_CONFIG_HOME/tmux/tmux.conf if not set instead of just default to $HOME/.tmux.conf. This minimizes the need to set the variable.
  3. Another new feature from upstream is automatically set $TERM variable to tmux or tmux-256color too instead of just screen and screen-256color.
budimanjojo commented 1 month ago

I will release the current state as v1 and v2 for this breaking change. So you can pin to v1 you prefer the old behavior.

budimanjojo commented 1 month ago

If you're updating, here are what you need to do to make it work just like the current default:

Here are the overview of the changes for v2:

Basically, v2 works exactly like the zsh plugin except for the different variable names ($ZSH_TMUX_XXX become $fish_tmux_xxx).