prezto icon indicating copy to clipboard operation
prezto copied to clipboard

Allow custom TMUX config path

Open pschmitt opened this issue 4 years ago • 3 comments

Proposed Changes

  • Right now the TMUX plugin only makes use of the default TMUX config path (~/.tmux.conf)
  • This PR allows users to set the path to their tmux config.

Example:

zstyle ':prezto:module:tmux:config' path "$XDG_CONFIG_HOME/tmux.conf"

pschmitt avatar Jun 06 '20 08:06 pschmitt

Thanks for the change @pschmitt. Though I'm divided on the utility of the changeset.

I use tmux and the default has location supported by tmux is ~/.tmux.conf. The usual workflow does not involve changing the location of the conf file and one can always alias tmux=tmux -f path which should solve the problem.

srijanshetty avatar Jun 06 '20 12:06 srijanshetty

Yes an alias could work, I personally don't "trust" aliases all that much and prefer to avoid relying on them.

Having the possibility to use a zstyle instruction at the module level is cleaner in my opinion. That's obviously debatable but here's how I see it: to have the tmux module behave if you don't use the default config path (which will change btw in 3.2) you have to do 2 things:

  1. setup an alias before the module get sourced
  2. configure the module via zstyle

Just doing 2. is better imho.

pschmitt avatar Jun 06 '20 12:06 pschmitt

Try $XDG_CONFIG_HOME/tmux/tmux.conf as well as ~/.config/tmux/tmux.conf for configuration file (the search paths are in TMUX_CONF in Makefile.am).

Did not know about this. Thanks for pointing it out :smile:

setup an alias before the module get sourced

The temporal coupling is just ugly, I agree.

Just doing 2. is better imho.

No doubt, 2 is the better implementation.

I'm just wondering if this is changeset is needed at all, and even if we do make this change, always using tmux -f $tmux_config in the changeset is a ticking time-bomb and people will forget to use it. Probably makes sense to define a local variable which would be more defensive than this.

Just want more opinions on this changeset.

srijanshetty avatar Jun 06 '20 14:06 srijanshetty