Skip to content

tpm update plugins doesn't work since b17d57f #631

Closed

Description

@Frederick888

Steps to reproduce

FROM archlinux

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

Build the image then run with podman/docker run --rm -it <image> bash.

In the container, run tmux, then <prefix> + U (this is my binding for tpm's update_plugins script; prefix is Ctrl-a), tpm displays an empty list of plugins.

Workaround

I noticed if I revert the source .tmux.conf.local line, i.e.

diff --git a/.tmux.conf b/.tmux.conf
index cd065a4..8f38db8 100644
--- a/.tmux.conf
+++ b/.tmux.conf
@@ -156,9 +156,9 @@ bind P choose-buffer    # choose which buffer to paste from
 %if #{==:#{TMUX_CONF_LOCAL},}
   run '"$TMUX_PROGRAM" set-environment -g TMUX_CONF_LOCAL "$TMUX_CONF.local"'
 %endif
 
-run '"$TMUX_PROGRAM" source "$TMUX_CONF_LOCAL"'
+source -q ~/.tmux.conf.local
 run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
 
 # EOF
 #

...then the issue is gone. No idea why though. I also tested source -F '#{TMUX_CONF_LOCAL}' but the issue persisted.

It seems somehow it just has to be ~/.tmux.conf.local (or $HOME/.tmux.conf.local).

I'm using tmux 3.3a btw.

Activity

  1. Frederick888 commented on Mar 6, 2023

    @Frederick888
    ContributorAuthor

    Ohhh, I think it's [1]!

    If I patch the file with

    diff --git a/scripts/helpers/plugin_functions.sh b/scripts/helpers/plugin_functions.sh
    index f33d215..3badce9 100644
    --- a/scripts/helpers/plugin_functions.sh
    +++ b/scripts/helpers/plugin_functions.sh
    @@ -44,8 +44,9 @@ _tmux_conf_contents() {
     }
     
     # return files sourced from tmux config files
     _sourced_files() {
    +	echo '~/.tmux.conf.local'
     	_tmux_conf_contents |
     		sed -E -n -e "s/^[[:space:]]*source(-file)?[[:space:]]+(-q+[[:space:]]+)?['\"]?([^'\"]+)['\"]?/\3/p"
     }
     

    ...then it's working again.

    [1] https://github.com/tmux-plugins/tpm/blob/99469c4a9b1ccf77fade25842dc7bafbc8ce9946/scripts/helpers/plugin_functions.sh#L49

  2. Frederick888 commented on Mar 6, 2023

    @Frederick888
    ContributorAuthor

    I can use source -F '#{TMUX_CONF_LOCAL}' with tmux-plugins/tpm#244

  3. gpakosz commented on Mar 6, 2023

    @gpakosz
    Owner

    Something's not quite right.

    By now Oh My Tmux! sets @tpm_plugins before invoking TPM.
    Specifically to avoir TPM having opinion on what configuration files are and how they're sourced.

    For now I can't reproduce on macOS and I don't have Docker Desktop installed.

  4. gpakosz commented on Mar 6, 2023

    @gpakosz
    Owner

    But now that I think about it, you may be facing a binding clash

    Can you please run the following command within a tmux pane?

    $ tmux lsk | grep ' U '
    bind-key    -T prefix       U                    run-shell "cut -c3- '#{TMUX_CONF}' | sh -s _urlview '#{pane_id}'"
    

    This is the default binding for U and you're trying to set it to something else.
    Please revert your patches and try this in your .local customization file

    bind U run-shell $HOME/.tmux/plugins/tpm/bindings/update_plugins #!important
    
  5. gpakosz commented on Mar 6, 2023

    @gpakosz
    Owner

    Please revert to a clean state, make sure you remove everything for good mesure and try the gh-631 branch

  6. Frederick888 commented on Mar 6, 2023

    @Frederick888
    ContributorAuthor

    Reverted my patches and with my current .tmux.conf.local:

    $ tmux lsk | grep ' U '
    bind-key    -T prefix       U                    run-shell /home/frederick/.tmux/plugins/tpm/bindings/update_plugins

    And if I use bind U run-shell $HOME/.tmux/plugins/tpm/bindings/update_plugins #!important, still without any of my own oh-my-tmux or tpm patches:

    tmux lsk | grep ' U '
    bind-key    -T prefix       U                    run-shell /home/frederick/.tmux/plugins/tpm/bindings/update_plugins

    <prefix> + U still shows an empty list

  7. gpakosz commented on Mar 6, 2023

    @gpakosz
    Owner

    Please also make sure your U binding is the proper one

  8. Frederick888 commented on Mar 6, 2023

    @Frederick888
    ContributorAuthor

    I don't see the gh-631 branch. Did you push?

  9. gpakosz commented on Mar 6, 2023

    @gpakosz
    Owner

    Now it's pushed!

  10. Frederick888 commented on Mar 6, 2023

    @Frederick888
    ContributorAuthor

    Yes it works! Also tested my original one without #!important, worked too!

  11. gpakosz commented on Mar 6, 2023

    @gpakosz
    Owner

    Nice. Maybe your TPM PR is useful to upstream but I didn't want to wait for such sort of adoption.

    I'll close this with merging gh-631. Thanks for the proper investigation. Appreciated!

  12. added a commit that references this issue on Jul 25, 2023
    4f4290f
  13. added a commit that references this issue on Aug 18, 2023
    4a6e356
  14. added a commit that references this issue on Jan 24, 2024
    9922d8f
  15. added a commit that references this issue on Jan 26, 2024
    a989554
  16. added a commit that references this issue on Dec 14, 2025
    9a9cdb1
  17. added a commit that references this issue on May 5, 2026
    d031098
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions