marlonrichert / zsh-autocomplete

🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
MIT License
5.17k stars 142 forks source link

sudo autocomplete broken #660

Closed Readf0x closed 7 months ago

Readf0x commented 9 months ago

Environment

% typeset -p1 VENDOR OSTYPE ZSH_PATCHLEVEL _autocomplete__funcfiletrace
typeset VENDOR=pc
typeset OSTYPE=linux-gnu
typeset ZSH_PATCHLEVEL=zsh-5.9-0-g73d3173
typeset -a _autocomplete__funcfiletrace=(
  /home/readf0x/.oh-my-zsh/custom/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh:4
  /home/readf0x/.oh-my-zsh/oh-my-zsh.sh:179
  /home/readf0x/.oh-my-zsh/oh-my-zsh.sh:208
  /home/readf0x/.zshrc:76
  zsh:0
)
% git -C ~autocomplete log --oneline -n1
b6bb133 (HEAD -> master, origin/master) fix(git): fix repository detection in `gccd` function (#12023)

Steps to reproduce

% cd $(mktemp -d)
% git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
<output>
% > .zshrc <<EOF
setopt interactivecomments transientrprompt
PS1='%# '
PS2=
RPS2='%^'
source $PWD/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
% sudo █
directory
Documents/  Downloads/  Games/      Music/      Pictures/   Public/     rift/       Steam@    
Templates/  Videos/     wine/                                                         
file
emoji.json                                      steam.desktop*
Contents of ~autocomplete-log/YYYY-MM-DD.log (click to expand)
❯ locate autocomplete
/usr/lib/node_modules/gluon-build/node_modules/prompts/dist/elements/autocomplete.js
/usr/lib/node_modules/gluon-build/node_modules/prompts/dist/elements/autocompleteMultiselect.js
/usr/lib/node_modules/gluon-build/node_modules/prompts/lib/elements/autocomplete.js
/usr/lib/node_modules/gluon-build/node_modules/prompts/lib/elements/autocompleteMultiselect.js
/usr/lib/python2.7/idlelib/idle_test/test_autocomplete.py
/usr/lib/python2.7/idlelib/idle_test/test_autocomplete.pyc
/usr/lib/python2.7/idlelib/idle_test/test_autocomplete.pyo
/usr/lib/python3.11/idlelib/autocomplete.py
/usr/lib/python3.11/idlelib/autocomplete_w.py
/usr/lib/python3.11/idlelib/__pycache__/autocomplete.cpython-311.opt-1.pyc
/usr/lib/python3.11/idlelib/__pycache__/autocomplete.cpython-311.opt-2.pyc
/usr/lib/python3.11/idlelib/__pycache__/autocomplete.cpython-311.pyc
/usr/lib/python3.11/idlelib/__pycache__/autocomplete_w.cpython-311.opt-1.pyc
/usr/lib/python3.11/idlelib/__pycache__/autocomplete_w.cpython-311.opt-2.pyc
/usr/lib/python3.11/idlelib/__pycache__/autocomplete_w.cpython-311.pyc
/usr/lib/python3.11/site-packages/hyfetch/scripts/autocomplete.bash
/usr/lib/python3.11/site-packages/hyfetch/scripts/autocomplete.csh
/usr/lib/python3.11/site-packages/hyfetch/scripts/autocomplete.zsh
/usr/lib/python3.11/site-packages/hyfetch/scripts/install-autocomplete.sh
/usr/lib/ruby/gems/3.0.0/doc/irb-1.4.2/ri/IRB/Context/use_autocomplete%3f-i.ri
/usr/lib/ruby/gems/3.0.0/doc/irb-1.4.2/ri/IRB/Context/use_autocomplete-i.ri
/usr/share/clang/bash-autocomplete.sh
marlonrichert commented 7 months ago

Works for me:

% cd $(mktemp -d)
% git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
% > .zshrc <<EOF
setopt interactivecomments transientrprompt
PS1='%# '
PS2=
RPS2='%^'
source $PWD/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
% env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
% sudo
external command
.DS_Store  .git           IOMFB_FDR_Loader  afhash   amt               comm     db_hotbackup  dmc            docker-credential-desktop  dwarfdump
edquota    fibreconfig    giftool           gm4      gyes              ifnames  jjs           libnetcfg5.30  libnetcfg5.34              mdls     
mig        net-snmp-cert  nfsstat           orbd     sdp               sdx      sed           seq            smbd                       snmpgetnext
syslogd    test-yaml5.30  test-yaml5.34     test.md  timer_analyser.d  tops     what          xzfgrep        xzgrep                     yacc     
yapp5.30   yapp5.34                                                                                                                

Have you tried with the latest version of Autocomplete?

Readf0x commented 7 months ago

@marlonrichert, It was a problem back when I made this issue, but it was fixed by an update to something a week or so after I opened it. I forgot it was still open, lol.