unixorn / tumult.plugin.zsh

Tumult is a collection of macOS-specific functions and scripts for your shell environment. It is packaged as a ZSH plugin, but can be used with other shells as well.
Apache License 2.0
165 stars 18 forks source link

The plugin disables autocomplete when only one option is available #132

Open aserrallerios opened 1 year ago

aserrallerios commented 1 year ago

I just type cd Down<TAB>.

Without the plugin:

❯ cd Downloads/

With the plugin:

❯ cd Down
local directory
Downloads/
unixorn commented 1 year ago

There are no bindkey, zstyle or zle commands in the plugin file, so I'm not sure how it is altering your tab completion behavior.

Which ZSH framework are you using?

aserrallerios commented 1 year ago

I'm loading a bunch of plugins (some from oh-my-zsh) with antibody. I tested loading this pluging both first and last of the list, and the problem persisted.

I compared the zstyle with and without the plugin, and it's identical, even though the autocomplete works differently (as described in the first message).

unixorn commented 1 year ago

That's really strange. Could you try starting with nothing but tumult in your plugin list and seeing if the behavior is still there?

I don't think the plugin sets any variables that should be altering tab completion behavior

aserrallerios commented 1 year ago

Yeah, I'll try the other way around. Add tumult and then add more and more of my other plugins until I identify the conflict.

Will keep you posted, thanks!

unixorn commented 1 year ago

Thanks, I appreciate the help. If there's something I'm doing in tumult to break tab completion behavior I want to know so I can pre-emptively fix it in my other plugins.

aserrallerios commented 1 year ago

So I found out that this combination reproduces the problem: oh-my-zsh "base" + tumult.

#~/.zsh_plugins.txt
robbyrussell/oh-my-zsh
unixorn/tumult.plugin.zsh

which translates to:

#~/.zsh_plugins.sh
source /Users/albert.serralle/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh/oh-my-zsh.sh
fpath+=( /Users/albert.serralle/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh )
source /Users/albert.serralle/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-unixorn-SLASH-tumult.plugin.zsh/tumult.plugin.zsh
fpath+=( /Users/albert.serralle/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-unixorn-SLASH-tumult.plugin.zsh )
#~/.zshrc
source ~/.zsh_plugins.sh

You should be able to reproduce by downloading both repos manually instead of using antibody.

unixorn commented 1 year ago

I'm not sure how I can fix it given that tumult doesn't make any ZSH settings changes, it just adds its bin directory to $PATH.

It does set up a few functions and aliases, I guess I can try turning those into full-on scripts so they don't alter the ZSH environment at all.

aserrallerios commented 1 year ago

But were you able to reproduce? I'm asking because I'm not 100% confident that other component of my setup is not interfering.

unixorn commented 1 year ago

I haven't had a chance to play with it, hoping to this weekend.