zsh-autocomplete icon indicating copy to clipboard operation
zsh-autocomplete copied to clipboard

Tab autocompletion picks first item instead of the longest common prefix

Open amomchilov opened this issue 1 year ago • 0 comments

Environment

apple darwin22.0 /bin/zsh -zsh zsh-5.8.1-0-g1a490c7
/Users/Alex/.zshrc:139
f52f45a (HEAD -> main, origin/main, origin/HEAD, my_fork/main) Change precmd to chpwd for zlua
  • Operating system: macOS
  • Terminal emulator: iTerm 2

Steps to reproduce

cd $(mktemp -d)
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
> .zshrc <<EOF
PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments
source ~/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
Cloning into 'zsh-autocomplete'...
remote: Enumerating objects: 59, done.
remote: Counting objects: 100% (59/59), done.
remote: Compressing objects: 100% (55/55), done.
remote: Total 59 (delta 0), reused 26 (delta 0), pack-reused 0
Receiving objects: 100% (59/59), 1.64 MiB | 7.70 MiB/s, done.
% mkdir Downloads Documents Drive
% cd a
directory
aaaaaaab/  aaaaaaac/
common substring: aaaaaaa

With cd D in the prompt, pressing tabs expands to the first item (aaaaaaab) instead of the common substring (aaaaaaa)

`zstyle -L` output ``` zstyle ':completion:*:expand:*' accept-exact continue zstyle ':completion:*:expand:*' add-space subst zstyle ':completion:*' auto-description %d zstyle -e ':completion:*' cache-path _autocomplete.config.cache-path zstyle ':completion:*:*:*:*:processes' command 'ps -u Alex -o pid,user,comm -w -w' zstyle ':completion:*' command '- COLUMNS=999' zstyle ':completion:*:expand-alias:*' complete yes zstyle ':completion:*' complete-options yes zstyle ':completion:list-expand:*' completer _expand _complete:-fuzzy _ignored zstyle ':completion:history-incremental-*search-*:*' completer _autocomplete.history_lines zstyle -e ':completion:*' completer _autocomplete.config.completer zstyle ':completion:*:paths' expand suffix zstyle ':completion:*:parameters' extra-verbose yes zstyle -e ':completion:*:-command-:*' file-patterns _autocomplete.config.file-patterns.command zstyle ':completion:*:(.|source):*' file-patterns '%p(#q-/):directories:directory %p~*.zwc(-.^*):globbed-files' '%p~*.zwc(-^/):globbed-files' zstyle ':completion:*' file-patterns '*(-/):directories:directory %p(#q^-/):globbed-files' zstyle ':completion:*:descriptions' format $'%{\C-[[0;2m%}%d%{\C-[[0m%}' zstyle -e ':completion:*:warnings' format _autocomplete.config.format zstyle ':completion:*:messages' format '%F{9}%d%f' zstyle ':completion:*:history-lines' format '' zstyle -e ':completion:*:expand:*' glob _autocomplete.is_glob zstyle ':completion:*' group-name '' zstyle ':completion:*' group-order expansions options aliases suffix-aliases functions reserved-words builtins commands local-directories directories executables zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })' zstyle ':completion:*:-command-:*' ignore-line current zstyle ':completion:*' ignore-parents 'parent pwd directory' zstyle ':completion:*:*:*:users' ignored-patterns adm amanda apache at avahi avahi-autoipd beaglidx bin cacti canna clamav daemon dbus distcache dnsmasq dovecot fax ftp games gdm gkrellmd gopher hacluster haldaemon halt hsqldb ident junkbust kdm ldap lp mail mailman mailnull man messagebus mldonkey mysql nagios named netdump news nfsnobody nobody nscd ntp nut nx obsrun openvpn operator pcap polkitd postfix postgres privoxy pulse pvm quagga radvd rpc rpcuser rpm rtkit scard shutdown squid sshd statd svn sync tftp usbmux uucp vcsa wwwrun xfs '_*' zstyle ':completion:*:users' ignored-patterns '_*' zstyle ':completion:*:widgets' ignored-patterns '.*' '*:*' '*orig-*' zstyle ':completion:*' insert-sections yes zstyle ':autocomplete:tab:*' insert-unambiguous yes zstyle ':autocomplete:shift-tab:*' insert-unambiguous yes zstyle ':completion:*:expand:*' keep-prefix no zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01' zstyle ':completion:*' list-colors '' zstyle ':completion:*:paths' list-suffixes yes zstyle ':completion:*:options' matcher 'b:-=+' zstyle ':completion:*-loose:*' matcher-list 'm:{[:lower:]-}={[:upper:]_} r:|[.]=** l:?|=[-_\\ ] r:?||[-_]=*' zstyle ':completion:*-fuzzy:*' matcher-list 'm:{[:lower:]-}={[:upper:]_} r:|?=**' zstyle ':completion:*' matcher-list 'm:{[:lower:]-}={[:upper:]_} r:|[.]=**' '+l:|=*' zstyle ':completion:*:paths' path-completion no zstyle ':completion:*' prefix-needed yes zstyle ':chpwd:*' recent-dirs-file /Users/Alex/.local/share/zsh/chpwd-recent-dirs zstyle ':chpwd:*' recent-dirs-max 0 zstyle ':completion:*:default' select-prompt '%F{black}%K{14}line %l %p%f%k' zstyle ':completion:*' separate-sections yes zstyle -e ':completion:*:expand:*' substitute _autocomplete.config.expand.substitute zstyle ':completion:list-expand:*:-command-:*' tag-order '*' zstyle ':completion:list-expand:*:git-*:(|*-)argument-*:*' tag-order '*' zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories zstyle ':completion:*:expand:*' tag-order '! all-expansions original' - zstyle -e ':completion:*:-command-:*' tag-order _autocomplete.config.tag-order.command zstyle ':completion:*:-tilde-:*' tag-order directory-stack named-directories zstyle ':completion:*:git-*:(|*-)argument-*:*' tag-order '! (|cached-)files *-remote remote-* (|*-)tags' '! *-remote remote-* tags' zstyle ':completion:*:(approximate|correct):*' tag-order '! original' - zstyle zle-hook types isearch-exit isearch-update line-pre-redraw line-init line-finish history-line-set keymap-select zstyle -e :url-quote-magic url-globbers $'zmodload -i zsh/parameter;\n\t reply=( noglob\n\t\t ${(k)galiases[(R)(* |)(noglob|urlglobber|globurl) *]:-}\n\t\t ${(k)aliases[(R)(* |)(noglob|urlglobber|globurl) *]:-} )' zstyle :urlglobber url-local-schema ftp file zstyle ':url-quote-magic:*' url-metas '*?[]^(|)~#{}=' zstyle :urlglobber url-other-schema http https ftp zstyle -e ':url-quote-magic:*' url-seps 'reply=(";&${histchars[1]}")' zstyle ':completion:*' use-cache yes zstyle ':autocomplete:tab:*' widget-style complete-word zstyle ':autocomplete:shift-tab:*' widget-style complete-word zstyle zle-line-init widgets 0:user:zle-line-init 1:.autocomplete.async.read-cursor-position 2:.autocomplete.async.reset-context 3:.autocomplete.async.complete zstyle zle-line-pre-redraw widgets 1:.autocomplete.async.complete zstyle zle-line-finish widgets 0:user:zle-line-finish 1:.autocomplete.async.clear zstyle zle-isearch-update widgets 1:.autocomplete.async.isearch-update zstyle zle-isearch-exit widgets 1:.autocomplete.async.isearch-exit ```

amomchilov avatar Jul 13 '22 01:07 amomchilov