mattmc3 / antidote

https://getantidote.github.io - the cure to slow zsh plugin management
MIT License
855 stars 21 forks source link

antidote-main: command not found #158

Closed xd003 closed 1 month ago

xd003 commented 11 months ago

I am trying to use antidote on Termux Android with zsh. When .zshrc got sourced the very first time, antidote did pulled all the plugins correctly. But now when i am running antidote update , it outputs the error mentioned in the title. This issue doesn't happen on both of my systems running Windows & Linux using antidote. Not really sure what's causing this issue here

.zshrc -

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

# Set the name of the static .zsh plugins file antidote will generate.
zsh_plugins=${ZDOTDIR:-~}/.zsh_plugins.zsh

# Ensure you have a .zsh_plugins.txt file where you can add plugins.
[[ -f ${zsh_plugins:r}.txt ]] || touch ${zsh_plugins:r}.txt

# Lazy-load antidote.
fpath+=(${ZDOTDIR:-~}/.antidote)
autoload -Uz $fpath[-1]/antidote

# Generate static file in a subshell when .zsh_plugins.txt is updated.
if [[ ! $zsh_plugins -nt ${zsh_plugins:r}.txt ]]; then
  (antidote bundle <${zsh_plugins:r}.txt >|$zsh_plugins)
fi

# Source your static plugins file.
source $zsh_plugins

# Use 16 colors
export FZF_DEFAULT_OPTS='--color 16'

# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh.
[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh

.zsh_plugins.txt

romkatv/powerlevel10k
ohmyzsh/ohmyzsh path:plugins/gitfast
ohmyzsh/ohmyzsh path:plugins/colored-man-pages
zimfw/fzf
zdharma-continuum/fast-syntax-highlighting

# completions
zsh-users/zsh-completions path:src kind:fpath
mattmc3/zephyr path:plugins/completion

# load last
zsh-users/zsh-autosuggestions
zsh-users/zsh-history-substring-search
❯ echo $SHELL
/data/data/com.termux/files/usr/bin/zsh
❯ zsh --version
zsh 5.9 (aarch64-unknown-linux-android)
mattmc3 commented 11 months ago

Unfortunately, this isn't enough to go on to help you solve it. There's nothing preventing antidote from working on a proper Zsh install on Android, but I can't debug your setup. If you want to post your config as well as version numbers I can have a look and see if anything sticks out.

I would recommend paring down to a small simple config just to test and make sure you have everything set up properly.

xd003 commented 11 months ago

@mattmc3 i have added .zshrc and .zsh_plugins.txt in my post. Actually i am just using the very same setup from my linux system wherein it works perfectly fine hence i am pretty confused why is this issue even happening in first place. If you need anything else do let me know

xd003 commented 10 months ago

Just did a complete reinstallation of Termux and setup antidote from scratch still this error shows up. Running which antidote outputs the following if it helps

❯ which antidote
antidote () {
        0=${(%):-%x}
        (( $+functions[antidote-main] )) || source ${0:A:h}/antidote.zsh
        antidote-main "$@"
}

On my Windows machine running git bash where i don't face this issue, running the same returns the following

❯ which antidote
antidote () {
        # undefined
        builtin autoload -XUz /c/Users/Admin/.config/zsh/.antidote
}

Maybe antidote is unable to create the function properly on termux in its current state

xd003 commented 10 months ago

Hello @mattmc3 Did you got around looking at this one

mattmc3 commented 10 months ago

I don't have a way to test on termux, but nothing you've posted looks out of the ordinary. You might try simplifying your config to this and see if it is working for you, and then slowly add back the parts until you find what breaks:

source ${ZDOTDIR:-~}/.antidote/antidote.zsh
antidote load
xd003 commented 10 months ago

I don't have a way to test on termux, but nothing you've posted looks out of the ordinary. You might try simplifying your config to this and see if it is working for you, and then slowly add back the parts until you find what breaks:

source ${ZDOTDIR:-~}/.antidote/antidote.zsh
antidote load

I just wiped clean my .zshrc and only having the 2 lines you mentioned, running antidote update outputs the following. The command itself seems to be working, although there's some error at the end

 u0_a472@localhost  ~  antidote update
Updating bundles...
Waiting for bundle updates to complete...
Bundle updates complete.
Updating antidote...
Antidote self-update complete.

__antidote_setup:8: no matches found: /data/data/com.termux/files/home/.config/zsh/.antidote/functions/*
mattmc3 commented 10 months ago

How did you install antidote? Seems like you have an incomplete install? You should remove and re-clone:

rm -rf -- ${ZDOTDIR:-$HOME}/.antidote
git clone https://github.com/mattmc3/antidote ${ZDOTDIR:-$HOME}/.antidote
xd003 commented 10 months ago

How did you install antidote? Seems like you have an incomplete install?

git clone --depth=1 https://github.com/mattmc3/antidote.git "$HOME/.config/zsh/.antidote"

I had installed it with this command directly within my ZDOTDIR

Edit - Even after running the 2 commands you mentioned, i am still getting that same error

mattmc3 commented 1 month ago

Closing due to age, isolation to one user, and inability of developer to reproduce issue.