Skip to content

Autocomplete repeatadly adding a semicolon";" to the end of a command on up arrow #797

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

Closed
sarg3nt opened this issue Mar 25, 2025 · 12 comments

Comments

@sarg3nt
Copy link

sarg3nt commented Mar 25, 2025

Environment

typeset VENDOR=redhat
typeset OSTYPE=linux-gnu
typeset ZSH_PATCHLEVEL=zsh-5.8-0-g77d203f
typeset -a _autocomplete__funcfiletrace=(
  /home/vscode/.oh-my-zsh/custom/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh:4
  /home/vscode/.oh-my-zsh/oh-my-zsh.sh:175
  /home/vscode/.oh-my-zsh/oh-my-zsh.sh:204
  /home/vscode/.zshrc:93
  /tmp/vscode-code-zsh/.zshrc:31
  zsh:0
)
  • Operating system: Rocky Linux 9.3
  • Terminal emulator: Microsoft Terminal, with WSL 2

Details

After upgrading to latest version of this plugin we are now getting a new semi colon added to the end of the line each time up arrow is used to get to the last history item.

Image

Image

Image

Image

No other .zshrc changes were made.
I tried installing the latest version of oh-my-zsh and it didn't help
I tried removing pretty much all configuration from the .zshrc, including all other zsh plugins and it didn't help except removing the call to load oh-my-zsh, i.e. source $ZSH/oh-my-zsh.sh

@sarg3nt sarg3nt added the bug label Mar 25, 2025
@tiankaima
Copy link

Happens to me. Three bisect gives me this:

8993b9c742ecaa5f0ecc21413c2980942ab790cb is the first bad commit
commit 8993b9c742ecaa5f0ecc21413c2980942ab790cb
Author: Marlon Richert <marlonrichert@users.noreply.github.com>
Date:   Wed Mar 19 12:20:02 2025 +0200

    Fix wrong binding of completion menu shortcut

 Functions/Init/.autocomplete__key-bindings | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

8993b9c looks like an intended feature rather than an introduced bug tho. I'm resetting back to https://github.com/marlonrichert/zsh-autocomplete/tree/24.09.04 do let me know when this is resolved.

tiankaima added a commit to tiankaima/Dockerfile that referenced this issue Mar 31, 2025
@c0desurfer
Copy link

Happens to me as well.

@mihaizer
Copy link

mihaizer commented Apr 7, 2025

I'm also have this problem

@KidesLeo
Copy link

KidesLeo commented Apr 8, 2025

Bump

@mukelarvin
Copy link

I just installed it for the first time and thought maybe I was doing something wrong. Glad to see it isn't just me.

@catman85
Copy link

same

@marlonrichert
Copy link
Owner

@tiankaima I think you did something wrong with your bisect, because 8993b9c does not affect that functionality at all.

@marlonrichert
Copy link
Owner

I'm unable to reproduce this. Here's what I did:

 % 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

~TMPDIR/tmp.DJoysD5zfQ/
Cloning into 'zsh-autocomplete'...
remote: Enumerating objects: 54, done.
remote: Counting objects: 100% (54/54), done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 54 (delta 0), reused 33 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (54/54), 1.64 MiB | 5.34 MiB/s, done.
% echo foo
foo
<press up arrow>
% echo foo;
<press enter>
% echo foo 
foo
<press up arrow>
% echo foo;
<press enter twice>
% echo foo 
foo
% history 
    1  echo foo
    2  echo foo
    3  echo foo
%

I'll reopen this if you can give me a reproducible test case.

@marlonrichert marlonrichert closed this as not planned Won't fix, can't repro, duplicate, stale Apr 22, 2025
@tiankaima
Copy link

@tiankaima I think you did something wrong with your bisect, because 8993b9c does not affect that functionality at all.

Yeah you're right on this. I'm having zsh in tmux so the whole thing is messed up and perhaps I forgot to create a new zsh or so. A new bisect gives me 11f1145 this time I think it might be onto something

(base) [~]$ cd /home/user/.oh-my-zsh/custom/plugins/zsh-autocomplete
(base) [~autocomplete]$ git status                                                               [11f1145]
HEAD detached at 11f1145
You are currently bisecting, started from branch 'main'.
  (use "git bisect reset" to get back to the original branch)

nothing to commit, working tree clean
(base) [~autocomplete]$ git status;                                                              [11f1145]
HEAD detached at 11f1145
You are currently bisecting, started from branch 'main'.
  (use "git bisect reset" to get back to the original branch)

nothing to commit, working tree clean
(base) [~autocomplete]$ git status;;                                                             [11f1145]
zsh: parse error near `;;'
(base) [~autocomplete]$ git bisect bad                                                           [11f1145]
11f11457cda2dc64c61a6911628b7c91fc2a94ac is the first bad commit
commit 11f11457cda2dc64c61a6911628b7c91fc2a94ac
Author: Marlon Richert <marlonrichert@users.noreply.github.com>
Date:   Wed Mar 19 12:22:30 2025 +0200

    Improve history line suffix removal

 Completions/_autocomplete__history_lines | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

I am still able to reproduce the bug with the MRE:

(base) [~autocomplete]$ cd $(mktemp -d)                                                          [11f1145]
(base) [/tmp/tmp.7kUgMVRJl7]$ git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
Cloning into 'zsh-autocomplete'...
remote: Enumerating objects: 54, done.
remote: Counting objects: 100% (54/54), done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 54 (delta 0), reused 33 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (54/54), 1.64 MiB | 1.01 MiB/s, done.
(base) [/tmp/tmp.7kUgMVRJl7]$ > .zshrc <<EOF
setopt interactivecomments transientrprompt
PS1='%# '
PS2=
RPS2='%^'
source $PWD/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
(base) [/tmp/tmp.7kUgMVRJl7]$ cat .zshrc
setopt interactivecomments transientrprompt
PS1='%# '
PS2=
RPS2='%^'
source /tmp/tmp.7kUgMVRJl7/zsh-autocomplete/zsh-autocomplete.plugin.zsh
(base) [/tmp/tmp.7kUgMVRJl7]$ env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
% echo foo
foo
% echo foo;
foo
% echo foo;;
zsh: parse error near `;;'
%

@m6w6
Copy link

m6w6 commented Apr 23, 2025

Maybe it depends on the version of zsh?
For me it happens with zsh 5.8.1 (aarch64-unknown-linux-gnu), but not zsh 5.9 (arm64-apple-darwin24.0).
Both with zsh-autocomplete 25.03.19 installed by homebrew.

EDIT: wait, sorry, actually it's 24.09.04 that's working...

@vguo2037
Copy link

vguo2037 commented Apr 23, 2025

Could be lines 134-136 in file Completions/_autocomplete__history_lines (lines 111-112 in commit 0edbeca), where under specific conditions the suffix ; is added.

EDIT: My guess is that excluding widgets like menu-select from the $WIDGETSTYLE == *-select* condition on line 134 would fix it.

@fshuva
Copy link

fshuva commented Apr 30, 2025

Seeing this issue with 25.03.19 and zsh version 5.8.1 on Ubuntu 22.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests