tmux-plugins / tpm

Tmux Plugin Manager
MIT License
11.95k stars 420 forks source link

tpm returning 1 #174

Closed PrincessRTFM closed 4 years ago

PrincessRTFM commented 4 years ago

Upon reloading my tmux config, pressing prefix + I or prefix + U, or restarting my tmux server, I get the message '~/.tmux/plugins/tpm/tpm' returned 1 every time. No other information is printed. When I press prefix + I it shows up twice, the others only display it once. I'm on tmux 3.1b, built from source. My config file ends with the following lines:

# set plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-open'

# configure plugins
set -g @sidebar-plus-position "right"
set -g @open-S 'https://www.startpage.com/do/search?cat=web&cmd=process_search&language=english&engine0=v1all&abp=1&query='
set -g @open 'C-f'
set -g @open-editor 'C-e'
set -g @yank_selection_mouse 'primary'

source-file ~/.tmux.theme.conf

# status line overrides for being ssh'd in
if-shell 'test -n "$SSH_CLIENT"' 'source-file ~/.tmux.remote.conf'

# load plugins
run -b '~/.tmux/plugins/tpm/tpm'

I updated TPM via git pull and restarted my tmux server, and the issue hasn't changed.

PrincessRTFM commented 4 years ago

It may be worth noting also that my plugins at least appear to be loading. tmux-yank and tmux-open, for instance, are both functional, and using the options listed in my config file. vim-tmux-navigator seems to work normally as well.

PrincessRTFM commented 4 years ago

Running bash -x tpm gets up to the point of calling scripts/source_plugins.sh. At that point, no further output is produced, even if I add set -x as the top line (beneath the shebang) in that file, and the exit code of 1 is returned after a few seconds. Looking through that file, I found that it's running every *.tmux file within each plugin directory as an executable, redirecting all output to /dev/null. Manually going through each plugin and doing the same without output redirection, I found that tmux-open/open.tmux prints unknown key: editor twice and then exits with status code 1. Calling bash -x tmux-open/open.tmux produces a pretty large amount of output, but what jumps out is that "unknown key: editor" is printed after tmux bind-key -T copy-mode editor send-keys [...] at the bottom. Further examination a ways up (combined with checking the tmux-open source) shows that the issue appears to be in their code for setting the copy-and-open-search-engine keybindings.

This issue therefore seems to be in the tmux-open plugin, not in TPM. Sorry for reporting it in the wrong place.

strazto commented 4 years ago

I'm getting the same error on tmux 3.1b . Given that (thanks to you) I can assume that tpm (probably) isn't responsible, it's likely one of my plugins.

From what I can see, I think that this issue is likely a result of some breaking changes introduced around tmux 3.1, as I only started seeing this when I upgraded from 3.0a.

Their release notes don't really suggest breaking changes between 3.0->3.1 (i think they only increment major versions on breaking changes), but nonetheless, something has changed that's broken my plugins

PrincessRTFM commented 4 years ago

It may be a plugin update that's broken something. If you have the patience, try doing what I did - run each plugin file without output redirection to look for an error or a nonzero exit code, then use bash -x on the file that's broken to locate the specific cause. Or at least open a report on the particular plugin's repo to let the author know.

strazto commented 4 years ago

I followed your debugging instructions, which was helpful in getting the output that I needed.

Eventually i found out it was due to a client-server mismatch that only seemed to happen under certain conditions, which I was able to address by fully uninstalling version 3 (from apt), and then reinstalling 3.1 from source.

willchao612 commented 2 years ago

Turns out indeed it's not TPM's fault. I found the problem was actually related to tmux-mem-cpu-load the plugin (the original issue). The last line to load all plugins met with an error produced by failure to activate this plugin (I missed cmake which is one of its dependencies). After it being installed, sourcing the config file didn't throw any errors and all plugins are loaded successfully.

colout commented 3 months ago

I got this error on mac and nearly pulled out what's left of my hair trying to resolve (digging tpm entrypoint and helper scripts, changing my zsh env around, trying different path combinations for plugins and the tmux config).

Turns out brew uninstall tmux brew install tmux fixed this error. 🤦

Not the same root cause as OP, but this is the top search result for this error. I'm hoping this might save a poor soul in the future if they stumble upon this issue.

wzh4464 commented 2 months ago

I have the same issue without installing tmux-mem-cpu-load. Should this be open again?