Zsh-autocomplete: can't clobber paremeter

Created on 5 Jun 2020  路  15Comments  路  Source: marlonrichert/zsh-autocomplete

I am seeing this error when almost every command I run right now. Mostly seems to be shell built ins though actually.

_autocomplete.async-list-choices:6: can't clobber parameter _autocomplete__async_fd containing file descriptor 25

zsh 5.8 (amd64-portbld-freebsd12.1
FreeBSD fluffy.lan 12.1-STABLE FreeBSD 12.1-STABLE r361783 GENERIC amd64

Using zimfw for my zshrc setup

All 15 comments

Thanks for letting me know! I鈥檒l look into it.

@gregf I just tried zsh-autocomplete with a clean install of zimfw on zsh 5.8 and it works fine for me.

Can you please send me a copy of your .zshrc and .zimrc files, so I can investigate what might be the cause of the problem?

It was my fault. I had another zsh-autocomplete repo listed, so they were conflicting. Sorry to waste your time!

@gregf I'm running into this same issue. What do you mean exactly by "I had another zsh-autocomplete" repo listed?

@adam-beck He means he was sourcing zsh-autocomplete twice. That doesn't work. 馃檪

I shouldn't have closed this, it appears to be happening agin this morning with out sourcing the repo twice. This is my configs.

# Start configuration added by Zim install {{{
# -------
# Modules
# -------

# Sets sane Zsh built-in environment options.
zmodule environment
# Provides handy git aliases and functions.
zmodule git
# Applies correct bindkeys for input events.
zmodule input
# Sets a custom terminal title.
zmodule termtitle
# Utility aliases and functions. Adds colour to ls, grep and less.
zmodule utility

#
# Prompt
#

zmodule romkatv/powerlevel10k

#
# Load some oh-my-zsh plugs
#

zmodule ohmyzsh/ohmyzsh -f 'plugins/terraform' -s 'plugins/terraform/terraform.plugin.zsh'
zmodule ohmyzsh/ohmyzsh -f 'plugins/bundler' -s 'plugins/bundler/bundler.plugin.zsh'
zmodule ohmyzsh/ohmyzsh -f 'plugins/ansible' -s 'plugins/ansible/ansible.plugin.zsh'
zmodule ohmyzsh/ohmyzsh -f 'plugins/emacs' -s 'plugins/emacs/emacs.plugin.zsh'

# Additional completion definitions for Zsh.
zmodule marlonrichert/zsh-autocomplete
# Enables and configures smart and extensive tab completion.
# completion must be sourced after zsh-users/zsh-completions
zmodule completion
# Fish-like autosuggestions for Zsh.
zmodule zsh-users/zsh-autosuggestions
# Fish-like syntax highlighting for Zsh.
# zsh-users/zsh-syntax-highlighting must be sourced after completion
zmodule zsh-users/zsh-syntax-highlighting
# Fish-like history search (up arrow) for Zsh.
# zsh-users/zsh-history-substring-search must be sourced after zsh-users/zsh-syntax-highlighting
zmodule zsh-users/zsh-history-substring-search
# }}} End configuration added by Zim install
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.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

# Start configuration added by Zim install {{{
#
# User configuration sourced by interactive shells
#

# -----------------
# Zsh configuration
# -----------------

#
# History
#

# If you come from bash you might have to change your $PATH.
export PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/bin:$HOME/.gem/bin/:$HOME/projs/go/bin:$HOME/bin:$HOME/.emacs.d/bin:/usr/local/bin:/usr/lib/w3m:/usr/local/libexec/w3m:$PATH

BASE16_SHELL="$HOME/.config/base16-shell/"
[ -n "$PS1" ] && \
    [ -s "$BASE16_SHELL/profile_helper.sh" ] && \
        eval "$("$BASE16_SHELL/profile_helper.sh")"

[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return

limit coredumpsize 0

# Remove older command from the history if a duplicate is to be added.
setopt HIST_IGNORE_ALL_DUPS

#
# Input/output
#

# Set editor default keymap to emacs (`-e`) or vi (`-v`)
bindkey -v

# Prompt for spelling correction of commands.
setopt CORRECT

# Customize spelling correction prompt.
#SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? '

# Remove path separator from WORDCHARS.
WORDCHARS=${WORDCHARS//[\/]}


# --------------------
# Module configuration
# --------------------

#
# completion
#

# Set a custom path for the completion dump file.
# If none is provided, the default ${ZDOTDIR:-${HOME}}/.zcompdump is used.
#zstyle ':zim:completion' dumpfile "${ZDOTDIR:-${HOME}}/.zcompdump-${ZSH_VERSION}"

#
# git
#

# Set a custom prefix for the generated aliases. The default prefix is 'G'.
#zstyle ':zim:git' aliases-prefix 'g'

#
# input
#

# Append `../` to your input for each `.` you type after an initial `..`
zstyle ':zim:input' double-dot-expand yes

#
# termtitle
#

# Set a custom terminal title format using prompt expansion escape sequences.
# See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes
# If none is provided, the default '%n@%m: %~' is used.
#zstyle ':zim:termtitle' format '%1~'

#
# zsh-autosuggestions
#

# Customize the style that the suggestions are shown with.
# See https://github.com/zsh-users/zsh-autosuggestions/blob/master/README.md#suggestion-highlight-style
#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'

#
# zsh-syntax-highlighting
#

# Set what highlighters will be used.
# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)

# Customize the main highlighter styles.
# See https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md#how-to-tweak-it
#typeset -A ZSH_HIGHLIGHT_STYLES
#ZSH_HIGHLIGHT_STYLES[comment]='fg=10'

# ------------------
# Initialize modules
# ------------------

if [[ ${ZIM_HOME}/init.zsh -ot ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
  # Update static initialization script if it's outdated, before sourcing it
  source ${ZIM_HOME}/zimfw.zsh init -q
fi
source ${ZIM_HOME}/init.zsh

# ------------------------------
# Post-init module configuration
# ------------------------------

#
# zsh-history-substring-search
#

# Bind ^[[A/^[[B manually so up/down works both before and after zle-line-init
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down

# Bind up and down keys
zmodload -F zsh/terminfo +p:terminfo
if [[ -n ${terminfo[kcuu1]} && -n ${terminfo[kcud1]} ]]; then
  bindkey ${terminfo[kcuu1]} history-substring-search-up
  bindkey ${terminfo[kcud1]} history-substring-search-down
fi

bindkey '^P' history-substring-search-up
bindkey '^N' history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
# }}} End configuration added by Zim install
export GIT_AUTHOR_EMAIL="[email protected]"
export GIT_AUTHOR_NAME="Greg Fitzgerald"
export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
export GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME

export MINICOM="-m -c on"
GPG_TTY=$(tty)
export GPG_TTY
eval "$(gpg-agent --daemon >/dev/null 2>&1)"
export GIT_TERMINAL_PROMPT=1

# You may need to manually set your language environment
export LANG=en_US.UTF-8

bindkey '^n' autosuggest-accept

alias zshsrc="e ~/.zshrc"
alias ncdu='ncdu --color dark'
alias m="mpv"
alias r="ranger"
alias pod="ranger ~/podcasts"
alias tv="ranger /mnt/media/tv"
alias movies="ranger /mnt/media/movies"
alias dmu="~/.emacs.d/bin/doom update && ~/.emacs.d/bin/doom refresh"
alias p='podfetcher'
alias pls='podfetcher lsnew'
alias pu='podfetcher update; podfetcher lsnew'
alias pf='podfetcher lsnew; podfetcher fetch; podfetcher catchup'
alias pds='p lscasts | grep -i'
alias rntv='media-sort --recursive --overwrite-if-larger  -t /mnt/media/tv/tv/ /mnt/media/tv/unsorted/'
alias rnmv='media-sort --recursive --overwrite-if-larger  -m /mnt/media/movies/movies/ /mnt/media/movies/unsorted/'
alias gcl='git clone'
alias sv="doas service"
alias n='ncmpcpp'
alias bat='bat --theme base16'
alias gclean='go clean -cache -modcache'
alias myip='curl ifconfig.co'
alias feeds='e ~/.config/podfetcher/feeds'
alias sys-info='inxi -Fxzc0'
alias wp='~/bin/wallpaper'
alias reboot='doas reboot'
alias poweroff='doas poweroff'
alias cpv='rsync -rtlvH --progress --delay-updates'
alias tmux='tmux -u'
alias keygen='ssh-keygen -o -a 100 -t ed25519'
alias gomodup="go get -u all"
alias mutt='neomutt'
alias sudo='doas'
alias webcam="mpv --no-resume-playback av://v4l2:/dev/video0"
alias yt='youtube-dl -c'
alias renet='doas /etc/rc.d/netif restart && doas /etc/rc.d/routing restart'


keychain -q ~/.ssh/id_ed25519
source ~/.keychain/$(hostname)-sh

export GEM_HOME=$HOME/.gem
export GEM_PATH=$HOME/.gem

if [[ -x /usr/bin/apt-get ]]; then
  alias install="sudo apt install"
  alias remove="sudo apt remove"
  alias search="apt search"
  alias upgrade="sudo apt update && sudo apt upgrade"
  alias show="apt-cache policy"
  alias clean="sudo apt autoremove && sudo apt-get autoclean"
fi

if [[ -x /usr/bin/pacman ]]; then
  alias remove="sudo pacman -Rs"
  alias install="yay -S --noconfirm"
  alias search="yay -Ss"
  alias isearch="pac"
  alias upgrade="yay -Syu --noconfirm"
  alias clean="sudo pacman -Scc && sudo pacman -Rns $(pacman -Qtdq)"
fi

if [[ -x /usr/sbin/pkg ]]; then
  alias remove="doas pkg remove"
  alias install="doas pkg install"
  alias search="pkg search"
  alias upgrade="doas pkg upgrade"
  alias plock="doas pkg lock"
  alias pup="doas portmaster -a"
fi

source ~/bin/grc.zsh

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

@gregf Sorry, that's too much customization for me to test with. You are sourcing and loading a bunch of things that I don't have access to.

Can you please disable your plugins and other sourced files one by one to see what it is that conflicts with zsh-autocomplete? Once we know the source of the conflict, then I can fix it.

@marlonrichert removing this might have fixed it. zsh-users/zsh-autosuggestions

@gregf That cannot be it, because if I run just a standard install of zimfw (which includes zsh-users/zsh-autosuggestions) plus zsh-autocomplete, then it works just fine.

shrugs it's been fine since I removed it. Does the order matter?

If you want to use both, then zsh-autocomplete should preferably come before zsh-autosuggestions, but it should not really matter that much.

You must still have some other customization getting in the way, because I'm unable to reproduce it with just zimfw, zsh-users/zsh-autosuggestions and zsh-autocomplete.

@adam-beck Would you happen to have a minimal test case with which I can reproduce the problem?

@gregf @adam-beck I just now randomly managed to reproduce this by creating an empty variable on the command line, like a= or 1=.

I pushed in a fix on the dev branch. Can you please check out the dev branch and see if this fixes it for you?

Do this by going to the dir where you cloned zsh-autocomplete and do

git pull
git checkout dev

then restart your terminal.

@marlonrichert looks fixed to me. Ty!

Great! I've now merged it into master, so you can go back to using that branch.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PSalant726 picture PSalant726  路  8Comments

weilbith picture weilbith  路  7Comments

cenk1cenk2 picture cenk1cenk2  路  3Comments

CallumHoward picture CallumHoward  路  7Comments

windowswithoutborders picture windowswithoutborders  路  6Comments