Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with zoxide z <space><tab> shortcut #706

Open
aacebedo opened this issue Mar 22, 2024 · 5 comments
Open

Incompatibility with zoxide z <space><tab> shortcut #706

aacebedo opened this issue Mar 22, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@aacebedo
Copy link

aacebedo commented Mar 22, 2024

When installing and using zsh-autocomplete with z-shell/zsh-zoxide,
zoxide command is repeated 4 times when using the shorcut
z <directory-to-search><SPACE><TAB>

and does not validate in the end

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/aacebedo/.zi/plugins/marlonrichert---zsh-autocomplete/zsh-autocomplete.plugin.zsh:4
  /home/aacebedo/.zi/bin/zi.zsh:1623
  /home/aacebedo/.zi/bin/zi.zsh:1516
  /home/aacebedo/.zi/bin/zi.zsh:1215
  /home/aacebedo/.zi/bin/zi.zsh:2507
  /home/aacebedo/.zshrc:7
  zsh:0
)
% git -C ~autocomplete log --oneline -n1
c7b6550 (HEAD -> main, origin/main, origin/HEAD) Add instructions on how to insert longest common prefix
  • Operating system: NixOS
  • Terminal emulator: Alacritty

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='%^'
if [ ! -d ~/.zi ]; then
  source <(curl -sL init.zshell.dev); zzinit
fi
. ~/.zi/bin/zi.zsh
mkdir -p ~/.zi/completions
zi ice depth "1"
zi load romkatv/powerlevel10k
zi load marlonrichert/zsh-autocomplete
zi load z-shell/zsh-zoxide
zi cdreplay -q
EOF
% env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
% cd /etc
% x e<SPACE><TAB>
x /etc
x /etc
x /etc
x /etc
@aacebedo aacebedo added the bug Something isn't working label Mar 22, 2024
@aacebedo
Copy link
Author

aacebedo commented Mar 23, 2024

After digging more on this, I noticed this behaviour with zoxide directly.
I think something has changed on 0.9.4 that leads to this problem.

EDIT: Tried with 0.9.2 same behaviour.

@aacebedo aacebedo changed the title Incompatibility with z-shell/zsh-zoxide Incompatibility with zoxide z <space><tab> shortcut Mar 23, 2024
@aacebedo
Copy link
Author

Here is a gif showing the issue
test

@argamanza
Copy link

Didn't notice this issue and created #709 - any updates?

@ad-on-is
Copy link

@aacebedo
Slightly off topic, but... I noticed your .zshrc has the following lines

if [ ! -d ~/.zi ]; then
  source <(curl -sL init.zshell.dev); zzinit
fi

Which imposes a high security issue... What if init.zshell.dev at some point serves a very malicious script. If I were you, I'd remove that, and other similar scripts if you have any.

@aacebedo
Copy link
Author

@aacebedo Slightly off topic, but... I noticed your .zshrc has the following lines

if [ ! -d ~/.zi ]; then
  source <(curl -sL init.zshell.dev); zzinit
fi

Which imposes a high security issue... What if init.zshell.dev at some point serves a very malicious script. If I were you, I'd remove that, and other similar scripts if you have any.

Thanks for the remark. You are right I will modify this and keep a copy of the install script locally instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants