Closed davidstosik closed 4 years ago
๐ for this, the install steps are wrong in the documentation. At very least it should be updated with these steps.
I followed https://github.com/tmux-plugins/tpm/blob/master/docs/managing_plugins_via_cmd_line.md expect to run ~/.tmux/plugins/tpm/bin/update_plugins all
on zsh directly.
But I got:
unknown variable: TMUX_PLUGIN_MANAGER_PATH
FATAL: Tmux Plugin Manager not configured in tmux.conf
Aborting.
tmux new-session -d "sleep 1" && sleep 0.1 && ~/.tmux/plugins/tpm/bin/update_plugins all
works!
Thanks a lot!
Per author's detailed explanation I do believe this was a problem at some point. However, testing this line
tmux start-server\; show-environment -g TMUX_PLUGIN_MANAGER_PATH | cut -f2 -d=
with tmux versions 3.0a
and 3.1b
without tmux running I can't reproduce the problem.
I also just tried updating an individual plugin (on tmux 3.1b
) and it worked fine:
/Users/bruno/data/var/tmux/plugins/tpm/bin/update_plugins tmux-pain-control
@bruno- I'm on Manjaro got that problem, too.
hmanx ~ ยป tmux start-server\; show-environment -g TMUX_PLUGIN_MANAGER_PATH | cut -f2 -d=
unknown variable: TMUX_PLUGIN_MANAGER_PATH
Ok, I figured it out:
TMUX_PLUGIN_MANAGER_PATH
explicitly set in .tmux.conf
.TMUX_PLUGIN_MANAGER_PATH
from .tmux.conf
The issue seems to be with the last line from .tmux.conf
: run -b '~/.tmux/plugins/tpm/tpm'
The -b
flag causes the issue. Things work fine when the -b
flag is removed.
@roachsinai can you please try removing -b
from run -b '~/.tmux/plugins/tpm/tpm'
in your .tmux.conf
and see if this then works
tmux start-server\; show-environment -g TMUX_PLUGIN_MANAGER_PATH | cut -f2 -d=
Yeah, confirmed that. ~/.tmux/plugins/tpm/bin/update_plugins all
works if -b
removed from tmux.conf.
Ok, for now the fix is to remove -b
from the last line in your tmux.conf
. Have it look like this: run '~/.tmux/plugins/tpm/tpm'
.
-b
was added in #144. We'll revert that one unless there are some good reasons to keep -b
.
Hello @bruno-, sorry for the late answer, but I'm working on my dotfiles and found a link back to this issue! ๐
It looks like the problem is solved by removing the -b
flag.
With a fresh install of tmux
, the following script seems to get me started well! ๐๐ป
TPM="$HOME/.tmux/plugins/tpm"
mkdir -p "$TPM"
git clone https://github.com/tmux-plugins/tpm "$TPM"
cat <<TMUXCONF > "$HOME/.tmux.conf"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
run '$HOME/.tmux/plugins/tpm/tpm'
TMUXCONF
${TPM}/bin/install_plugins
While working on my dotfiles, and a way to have a mostly unattended way to setup my environment, I tripped on a problem with TPM.
Imagine this basic script
~/.dotfiles/tmux/install
:With this basic tmux configuration file in
~/.dotfiles/tmux/tmux.conf.symlink
:Now I'd like to add in my tmux setup script, the proper command that will install Tmux plugins (the unattended equivalent of
prefix
+ I).Digging in
tpm
's source code, I figured outprefix
+ I is bound to~/.tmux/plugins/tpm/bindings/install_plugins
, which clearly states https://github.com/tmux-plugins/tpm/blob/2ab1d9101b33f3162505aaa7f99ac32631ac4371/bindings/install_plugins#L4I thought that I could then call
~/.tmux/plugins/tpm/bin/install_plugins
from my setup script in order to install plugins. Unfortunately, when I do, I receive the following error:I dug to find this error's origin and found this function: https://github.com/tmux-plugins/tpm/blob/0128e36fbe4298692fa755bfa584bd8d905f932a/scripts/helpers/plugin_functions.sh#L11-L14
As I see the first thing it does is to
start-server
, I imagine the script is supposed to work outside of tmux? Unfortunately it does not really:Reading this issue, it looks like
tmux start-server
does not actually start the server?It turns out I can get the command the command the command to work outside of tmux, but only if I managed to have the tmux server running at that time:
The following script seems to work both inside and outside tmux, even if tmux server is not running previously:
I don't have a great recommendation, but figure this might be worth looking into. (I figure if the existing script needs tmux to be running, then
start-server
is unnecessary? If it's supposed work with tmux server running, then this is a bug.)My workaround for now will be to add the following to my setup script: