tmux-plugins / tpm

Tmux Plugin Manager
MIT License
11.9k stars 417 forks source link

Actually using XDG_CONFIG_HOME #237

Closed jaclu closed 1 year ago

jaclu commented 1 year ago

This patch causes tpm to honor XDG_CONFIG_HOME when it comes to choosing where to install plugins

jaclu commented 1 year ago

Example testing of this. 1 copy your tmux.conf to something like ~/t2/tmux/tmux.conf 2 copy this patched tpm to ~/t2/tmux/plugins 3 change tmux.conf so that the run line points to the correct path run '$XDG_CONFIG_HOME/tmux/plugins/tpm/tpm'

  1. export XDG_CONFIG_HOME="/Users/jaclu/t2" # Doesnt seem to like ~, but not sure about that
  2. tmux -f ~/t2/tmux/tmux.conf 6 Install plugins with <P> I 7 You should now find them in ~/t2/tmux/plugins

Without this patch, the plugins would be installed to ~/.tmux/plugins despite the above steps

FranklinYu commented 1 year ago

I don’t think $XDG_CONFIG_HOME (or essentially any XDG variable) should contain a verbatin ~. ~ is a shell construct, while environment variables are at the operating-system level. When you do

export XDG_CONFIG_HOME=~/.config

the tilde is already expanded by the shell, before any application reads it. You can tell by inspecting the value of the variable.

jaclu commented 1 year ago

Strange previously I had issues with XDG_CONFIG_HOME not being used for plugin installs, they always got installed in ~/.tmux/plugins But today when I tested on several nodes it all worked as intended, so must have been some kind of user-error by me in my previous tests. Since this turned out not to be an issue in my second round of tests, there is no problem, so Im closing this feeling rather ridiculous :)