gpakosz / .tmux

🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
MIT License
21.79k stars 3.36k forks source link

b17d57f325957ca85c477fa3d80077da06cccf7c broke installation in home directory #630

Closed Frederick888 closed 1 year ago

Frederick888 commented 1 year ago

https://github.com/gpakosz/.tmux/blob/9941420c6d9b48cd08d47a2aa871acfbf49e7a44/.tmux.conf#L1429

When TMUX_CONF is $HOME/.tmux.conf, TMUX_PLUGIN_MANAGER_PATH becomes $HOME/plugins.

gpakosz commented 1 year ago

Hello @Frederick888 👋

Thanks for the report! Can you please try the gh-630 branch?

Frederick888 commented 1 year ago

Thanks for the quick response!

gh-630 fixed the plugins path however $HOME/.tmux/plugins/tpm/bindings/install_plugins and $HOME/.tmux/plugins/tpm/bindings/update_plugins still show an empty list somehow.

Frederick888 commented 1 year ago

In the first window after tmux starts, I don't have the $TMUX_PLUGIN_MANAGER_PATH environment variable:

$ echo $TMUX_PLUGIN_MANAGER_PATH

$ tmux show-environment -g TMUX_PLUGIN_MANAGER_PATH
TMUX_PLUGIN_MANAGER_PATH=/home/frederick/.tmux/plugins/

If I start a new window, $TMUX_PLUGIN_MANAGER_PATH then is populated correctly and I can install/update plugins

Frederick888 commented 1 year ago

Ah sorry, I was jumping between c5f598ea869f39a37f93a03f4ed0b62713ae8023 and gh-630 and confused myself.

The environment variable situation was the same in both commits. But in gh-630 I cannot update plugins no matter it's in the initial window or a new window.

gpakosz commented 1 year ago

In the first window after tmux starts, I don't have the $TMUX_PLUGIN_MANAGER_PATH environment variable

I'm sure this was happening before the refactor because installing and cloning TPM and its plugins happens in the background. So the first spawned shell is unlikely to inherit $TMUX_PLUGIN_MANAGER_PATH from the global environment.

But in gh-630 I cannot update plugins no matter it's in the initial window or a new window How do you update the plugins?

Frederick888 commented 1 year ago

How do you update the plugins?

I usually use my binding below actually (instead of invoking it directly):

bind U run-shell $HOME/.tmux/plugins/tpm/bindings/update_plugins

Using c5f598ea869f39a37f93a03f4ed0b62713ae8023 both work, and it works in the initial window too (I probably jumped to gh-630 in the middle of a test and got myself confused).

gpakosz commented 1 year ago

Using c5f598ea869f39a37f93a03f4ed0b62713ae8023 both work

"both work" as using <prefix> +U and invoking $HOME/.tmux/plugins/tpm/bindings/update_plugins directly?

Can you please remove $HOME/plugins and $HOME/.tmux/plugins then try gh-630 with a fresh tmux client and server?

gh-630 should solve the $TMUX_PLUGIN_MANAGER_PATH location, without solving that it's not available in the first created pane. Having $TMUX_PLUGIN_MANAGER_PATH available in the first created pane is something else

Frederick888 commented 1 year ago

"both work" as using +U and invoking $HOME/.tmux/plugins/tpm/bindings/update_plugins directly?

Yes

Can you please remove $HOME/plugins and $HOME/.tmux/plugins then try gh-630 with a fresh tmux client and server?

I can actually reproduce this in a container:

FROM archlinux

RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm tmux awk perl sed git curl python
RUN git clone --branch gh-630 https://github.com/gpakosz/.tmux.git /root/.tmux
RUN ln -s .tmux/.tmux.conf /root/
RUN curl -o /root/.tmux.conf.local https://git.tsundere.moe/Frederick888/frederick-settings/-/raw/master/.tmux.conf.local

Using this Dockerfile,

podman build -t tmux .
podman run --rm -it tmux bash
# in container
cd
tmux
# <prefix> + U or call the script (my prefix is Ctrl-a btw)
gpakosz commented 1 year ago

I pushed more changes in gh-630 which makes TMUX_PLUGIN_MANAGER_PATH available to the first created pane when tmux starts with Oh my tmux!'s .local customization file copy enabling TPM plugins.

But, if you start tmux without enabling plugins, and afterwards edit the configuration to enable them, then there's no way to update the first created pane's environment automatically.

gpakosz commented 1 year ago

I don't have much time ahead further debugging this today. In the meantime I think I'll just push the fixes for TMUX_PLUGIN_MANAGER_PATH pointing to the wrong location

Frederick888 commented 1 year ago

I don't have much time ahead further debugging this today. In the meantime I think I'll just push the fixes for TMUX_PLUGIN_MANAGER_PATH pointing to the wrong location

Thank you and please take you time :) I'll also need to head out soon anyway.

gpakosz commented 1 year ago

Using the gh-630, I can invoke $HOME/.tmux/plugins/tpm/bindings/update_plugins and TPM prompts me to update all or cancel

gpakosz commented 1 year ago

So I'll close this with fixes to TMUX_PLUGIN_MANAGER_PATH. Please open another issue for tmux plugins not updating if that's still the case for you