Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable non-default conf files #57

Open
macarenomarco opened this issue Oct 22, 2015 · 13 comments
Open

Enable non-default conf files #57

macarenomarco opened this issue Oct 22, 2015 · 13 comments
Labels

Comments

@macarenomarco
Copy link

When using a file that isn't /etc/tmux.conf ~/.tmux.conf tpm doesn't load the plugin list. Not sure if it'd be better to include a separate .tmux/tpm.conf file which could include the location of the tmux config file.

@bruno-
Copy link
Member

bruno- commented Oct 22, 2015

Hey,
yea, this is a known issue. If tmux server is started with -f flag (tmux -f /some/path/to/conf.file) it will not load the new plugin syntax. I'm not sure this can be fixed.

There are 2 solutions for this:

1: you can use legacy plugin list definition in /some/path/to/conf.file, example:

set -g @tpm_plugins '\
  tmux-plugins/tmux-foo \
  tmux-plugins/tmux-bar \
'

2: you might just source another config file from ~/.tmux.conf, example:

source /some/path/to/conf.file

Quick question: why do you even use a different config file?

@bruno- bruno- added the bug label Oct 22, 2015
@macarenomarco
Copy link
Author

Hey, sorry for taking so long and for not checking if this had been previously reported, my bad.
About the different config file, I use multiple OS's and would like to keep my configurations for tmux separate, however I imagine it might not be the most popular case, but that's why the second solution wouldn't always work.
It'd be awesome if tmux could return the location of it's config file but I haven't found anything of sorts, but I understand that having a single config file is way cooler and easier to use.
What about an optional @plugin-conf option? Or am I completely misunderstanding how the "@" functionality works?

@bruno-
Copy link
Member

bruno- commented Oct 23, 2015

It'd be awesome if tmux could return the location of it's config file but I haven't found anything of sorts

Yea, I also couldn't find anything for this. I think tmux maintainers could add a flag for this if we ask them. Wanna give it a try on tmux-users group?

What about an optional @plugin-conf option?

Can you elaborate this a bit? With this option: set -g @plugin-conf '/some/path/to/conf.file' tpm would read plugins from the additional file. But I think this is similar to just having source /some/path/to/conf.file.

Also, as mentioned above, the older syntax using @tpm_plugins is still supported. Did you try that one?

@macarenomarco
Copy link
Author

No, I haven't. I figured out that if it's a depecrated syntax there must be a good reason for it. But yeah you're right, I completely forgot about the fact that in order to load those values it's necessary to read the main conf file which is the issue.

I think I'll try with the tmux-users group and if that work update you on the situation.

@bruno-
Copy link
Member

bruno- commented Oct 24, 2015

Hey, the reason for deprecating @tpm_plugins is that the new syntax looks better and is easier to work with. Other than that things work the same.
If tmux core team won't provide a patch for this we'll un-deprecate @tpm_plugins, continue supporting it and just call it "old syntax".

@bruno-
Copy link
Member

bruno- commented Oct 24, 2015

I see tmux creator just responded positively to your request on tmux-users list.

@macarenomarco would you please forward that last message from the mailing list to my email? I'd like to respond to that thread, but it seems I need to have the email. I'm unable to respond via the web interface. Thanks

@charlesbjohnson
Copy link

This is also an issue for me (though I'm okay if I continue to use the old syntax).

I use a main tmux.conf that hooks up to a host specific tmux.conf.local and a plugin centric tmux.conf.plugins. Both of those files are are being sourced but tpm is unable to pick up on their contents (presumably because the sourcing happens conditionally at runtime?).

I support the un-deprecation of @tpm_plugins.

@bruno-
Copy link
Member

bruno- commented Dec 14, 2015

Hi guys,
the @tpm_plugins is un-deprecated with 620f06c.

The issue with tmux custom config file using -f option is now documented here. The solution using @tpm_plugins is suggested.

@HaleTom
Copy link

HaleTom commented Sep 12, 2018

FYI, anyone trying to follow the XDG Base Directory specification will run into this issue.

Arch users are directed to:

$ tmux -f "$XDG_CONFIG_HOME"/tmux/tmux.conf
$ export TMUX_TMPDIR="$XDG_RUNTIME_DIR"

https://wiki.archlinux.org/index.php/XDG_Base_Directory

@augustobmoura
Copy link

I think #77 might solve the problem, it's possible in new versions of tmux now

@sgleizes
Copy link

1: you can use legacy plugin list definition in /some/path/to/conf.file, example:

set -g @tpm_plugins '\
  tmux-plugins/tmux-foo \
  tmux-plugins/tmux-bar \
'

This solution only partially fixes the issue, as the list is still not updated by the function reload_tmux_environment which is called on install/update/clean. This means that editing the list of plugins at runtime and hitting e.g. <prefix>I will not install the new plugin(s), the tmux server has to be restarted entirely for it to work.

The problematic code is the aforementioned function in scripts/helpers/tmux_utils.sh.
IMHO one way to cleanly address this problem would be the @plugin-conf previously suggested, or an environment variable similar to TMUX_PLUGIN_MANAGER_PATH, e.g. TMUX_CONFIG.

In the mean time, using @tpm_plugins and patching the function locally does the job:
sed -i "s,~/.tmux.conf,$TMUX_CONFIG," scripts/helpers/tmux_utils.sh.

aignas added a commit to aignas/dotfiles that referenced this issue Jul 8, 2021
@ioogithub
Copy link

ioogithub commented Feb 23, 2022

I have been struggling with this issue for over an hour. I am using byobu. No matter what I do I cannot get tmp to download the plugins.

I have changed the syntax in my .tmux.conf file to use the depreciated @tpm_plugins syntax as recommended here: https://github.com/tmux-plugins/tpm/blob/master/docs/tpm_not_working.md

I then do a $ tmux source /path/to/my_tmux.conf and start byobu and press: prefix + I.

I see a message:

TMUX environment reloaded.
Done, press ENTER to continue.

When I check my plugins folder, nothing has been downloaded. According to the tpm_not_working page "The plugins should now be working."

I also tried following @sgleizes advice and running the above sed command however it didn't patch any files. Should I be able to press prefix + I and tpm will download the plugins at this point or is tpm fundamentally incompatible with byobu?

@pdecat
Copy link

pdecat commented Feb 24, 2022

Is tpm fundamentally incompatible with byobu?

I use TPM with byobu (so with a config file at ~/.byobu/.tmux.conf), and can confirm shortcuts to manage plugins like prefix + I do not work.

As a work-around, I run:

~/.byobu/tmux_plugins/tpm/bin/update_plugins all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants