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

tpm not downloading additional plugins from tmux.conf.local #671

Open
Clumsy-Coder opened this issue Sep 11, 2023 · 17 comments
Open

tpm not downloading additional plugins from tmux.conf.local #671

Clumsy-Coder opened this issue Sep 11, 2023 · 17 comments

Comments

@Clumsy-Coder
Copy link

Clumsy-Coder commented Sep 11, 2023

TPM doesn't seem to download tmux plugins when their defined in tmux.conf.local

commands run

rm -rf ~/.local/share/tmux ~/.config/tmux ~/.config/oh-my-tmux
git clone https://github.com/gpakosz/.tmux.git ~/.config/oh-my-tmux
mkdir -p ~/.config/tmux
ln -s ~/.config/oh-my-tmux/.tmux.conf ~/.config/tmux/tmux.conf
cp ~/dotfiles/tools/tmux/tmux.conf ~/.config/tmux/tmux.conf.local
tmux

~/.config/tmux/tmux.conf.local

source-file ~/dotifles/tools/tmux/plugins.tmux.conf

~/dotifles/tools/tmux/plugins.tmux.conf

set -g @plugin 'tmux-plugins/tmux-sensible'

ls -lah ~/.config/tmux

drwxr-xr-x   5 umar  staff   160B 12 Sep 09:11 .
drwxr-xr-x  22 umar  staff   704B 12 Sep 09:11 ..
drwxr-xr-x   4 umar  staff   128B 12 Sep 09:11 plugins
lrwxr-xr-x   1 umar  staff    41B 12 Sep 09:11 tmux.conf -> /Users/umar/.config/oh-my-tmux/.tmux.conf
-rw-r--r--   1 umar  staff    76B 12 Sep 09:11 tmux.conf.local

ls -lah ~/.config/tmux/plugins

total 8
drwxr-xr-x   4 umar  staff   128B 11 Sep 10:30 .
drwxr-xr-x   6 umar  staff   192B 11 Sep 10:30 ..
drwxr-xr-x  18 umar  staff   576B 11 Sep 10:30 tpm
-rw-r--r--   1 umar  staff    70B 11 Sep 10:30 tpm_log.txt

Not sure what am I missing

Clumsy-Coder added a commit to Clumsy-Coder/dotfiles that referenced this issue Sep 30, 2023
  ## what
  - move loading plugins to `tmux.conf`
    - move loading plugins from `./tools/tmux/plugins.tmux.conf` to `./tools/tmux/tmux.conf`

  ## how

  ## why
  -  since im using config from https://github.com/gpakosz/.tmux , it
     doesn't seem to load plugins if sourcing from another file
     - check gpakosz/.tmux#671

  ## where
  - ./tools/tmux/tmux.conf

  ## usage
Clumsy-Coder added a commit to Clumsy-Coder/dotfiles that referenced this issue Sep 30, 2023
  ## what
  - move loading plugins to `tmux.conf`
    - move loading plugins from `./tools/tmux/plugins.tmux.conf` to `./tools/tmux/tmux.conf`

  ## how

  ## why
  -  since im using config from https://github.com/gpakosz/.tmux , it
     doesn't seem to load plugins if sourcing from another file
     - check gpakosz/.tmux#671

  ## where
  - ./tools/tmux/tmux.conf

  ## usage
@gpakosz
Copy link
Owner

gpakosz commented Nov 27, 2023

Hello @Clumsy-Coder,

Oh my tmux! doesn't support sourcing yet another configuration file from the .local customization file.

@gpakosz
Copy link
Owner

gpakosz commented Jan 30, 2024

source-file [-Fnqv] path ...
              (alias: source)
        Execute commands from one or more files specified by path (which may be glob(7) patterns).  If -F is present, then path is expanded as a format.  If -q is given, no error will be returned if path
        does not exist.  With -n, the file is parsed but no commands are executed.  -v shows the parsed commands and line numbers if possible.

It's not trivial to support glob patterns in path, as well as the different options.

@atrestis
Copy link

Hello, I got the same issue, my plugins definition (for installation) is under user customizations section, however whenever I try to update/install new plugins I get the error of: "GitHub doesn't seem to be reachable, skipping installing and/or updating tpm and plugins...".

My tmux.conf.local is a symbolic link to my dotfiles configuration, although I don't see how this would be a problem.

Can anyone suggest any hints on how to resolve this?
Cheers

@augustobmoura
Copy link

Hello, I got the same issue, my plugins definition (for installation) is under user customizations section, however whenever I try to update/install new plugins I get the error of: "GitHub doesn't seem to be reachable, skipping installing and/or updating tpm and plugins...".

My tmux.conf.local is a symbolic link to my dotfiles configuration, although I don't see how this would be a problem.

Can anyone suggest any hints on how to resolve this? Cheers

This is definitely a problem, I have a similar setup, where .tmux.conf.local and tmux-fingers wasn't working at all. I fixed it by copying the file instead of linking it. A hard link would probably also make it work

@gpakosz
Copy link
Owner

gpakosz commented Oct 27, 2024

I fixed it by copying the file instead of linking it. A hard link would probably also make it work

This is unrelated to this issue.

Oh my tmux doesn't support having its .local customization file source more files.
As I mentioned in my initial comments, this is not trivial to solve.

@gpakosz
Copy link
Owner

gpakosz commented Oct 28, 2024

Can you please give the gh-671 branch a try?

This is supposed to support elaborated configurations like

~/.config/tmux/tmux.conf.local

source ~/dotifles/tools/tmux/plugins.tmux.conf

~/dotifles/tools/tmux/plugins.tmux.conf

set -g @plugin foo
set -g @plugin bar

%if "#{==:#{host},hostname1}"
source -qF '#{d:current_file}/hostname1-plugins.tmux.conf'
%endif

~/dotifles/tools/tmux/hostname1-plugins.tmux.conf

set -g @plugin baz
@gpakosz
Copy link
Owner

gpakosz commented Oct 29, 2024

Oh my tmux! now supports

%if "#{==:#{host},myhost}"
set -g @plugin foo
%else
set -g @plugin bar
%endif

Which stock TPM can't do 🙃

@gpakosz
Copy link
Owner

gpakosz commented Oct 29, 2024

Hello @Clumsy-Coder 👋

Are you still following this issue by chance?

@Clumsy-Coder
Copy link
Author

@gpakosz I'm still following this issue.

@gpakosz
Copy link
Owner

gpakosz commented Oct 29, 2024

@Clumsy-Coder Cool! Please tell me if the gh-671 branch works for you 🙏

@Clumsy-Coder
Copy link
Author

Clumsy-Coder commented Oct 31, 2024

@gpakosz I tried the branch. It works. I tested with the following steps

  1. Remove tmux folders
rm -rfv ~/.config/oh-my-tmux ~/.config/tmux ~/dotfiles/tools/tmux/
  1. create directory
mkdir -p ~/.config/tmux ~/dotfiles/tools/tmux/
  1. clone repo
git clone --branch gh-671 https://github.com/gpakosz/.tmux.git ~/.config/oh-my-tmux
  1. symlink oh-my-tmux config file
ln -sf ~/.config/oh-my-tmux/.tmux.conf ~/.config/tmux/tmux.conf
  1. add the plugin in ~/dotfiles/tools/tmux/plugin.tmux.conf. Using plugin tmux-menus
echo "set -g @plugin 'jaclu/tmux-menus'" > ~/dotfiles/tools/tmux/plugin.tmux.conf
  1. source the plugin.tmux.conf in ~/.config/tmux/tmux.conf.local
echo "source ~/dotfiles/tools/tmux/plugin.tmux.conf" > ~/.config/tmux/tmux.conf.local
  1. open tmux
tmux
  1. run installed plugin. tmux command prefix + \

NOTE: I tested it in a VM using vagrant and virtualbox as the VM runner. I used ubuntu-22.04 as the OS

NOTE: needs more testing. I had some weird behavior where I follow the steps mentioned above, and it doesn't work. Once I kill the tmux server and open a new tmux session, it works. This happens sometimes

NOTE: needs more testing. I had some weird behavior where I follow the steps mentioned above, and it works. I kill the tmux server and open a new tmux session, it would uninstall the plugins. This happens rarely, not sure why or how

installing.plugin.via.oh-my-tmux.and.tpm.webm
@gpakosz
Copy link
Owner

gpakosz commented Nov 8, 2024

@Clumsy-Coder Thank you for the test

I will have a look

@gpakosz
Copy link
Owner

gpakosz commented Nov 8, 2024

I can't reproduce the fact that plugins get uninstalled

Are you sure you don't have other configuration files around?

@gpakosz
Copy link
Owner

gpakosz commented Nov 8, 2024

In fact I can reproduce with vagrant

@gpakosz
Copy link
Owner

gpakosz commented Nov 8, 2024

I believe it happens when exiting and the background job that installs tmux plugins hasn't finished yet

@gpakosz
Copy link
Owner

gpakosz commented Nov 8, 2024

I think I was able to fix the discovery of the plugins that would sometimes return nothing, causing uninstallation

I pushed another commit to the branch

@Clumsy-Coder
Copy link
Author

@gpakosz I tried it again with steps mentioned earlier. It works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment