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

$((...)) in history causes history menu to get stuck #613

Open
PoonKinWang opened this issue Jul 5, 2023 · 4 comments
Open

$((...)) in history causes history menu to get stuck #613

PoonKinWang opened this issue Jul 5, 2023 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested

Comments

@PoonKinWang
Copy link

PoonKinWang commented Jul 5, 2023

Environment

% typeset -p1 VENDOR OSTYPE ZSH_PATCHLEVEL _autocomplete__funcfiletrace
typeset VENDOR=apple
typeset OSTYPE=darwin22.0
typeset ZSH_PATCHLEVEL=zsh-5.8.1-0-g1a490c7
typeset -a _autocomplete__funcfiletrace=(
  /Users/test/.oh-my-zsh/custom/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh:4
  /Users/test/.oh-my-zsh/oh-my-zsh.sh:158
  /Users/test/.zshrc:82
  zsh:0
% git -C ~autocomplete log --oneline -n1
6d059a3 (HEAD -> main, origin/main, origin/HEAD) Fix bugs in insertion logic
  • Operating system: macOS Monterey 12.6.5
  • Terminal emulator: default terminal

Steps to reproduce

% cd $(mktemp -d)
% git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
Cloning into 'zsh-autocomplete'...
remote: Enumerating objects: 55, done.
remote: Counting objects: 100% (55/55), done.
remote: Compressing objects: 100% (53/53), done.
remote: Total 55 (delta 0), reused 38 (delta 0), pack-reused 0
Receiving objects: 100% (55/55), 1.64 MiB | 5.16 MiB/s, done.
% > .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

Open a new terminal and then key in:

% x=10
% $((x/10))
zsh: command not found: 1

Then press up key and the cursor will blink between the first and last lines of the terminal.
Then press ctrl+c and key in something and then the window of terminal will disappear.
And the htop will display that zsh occupies a significant amount of CPU time.

Screenshot 2023-07-06 at 03 10 42
@PoonKinWang PoonKinWang added the bug Something isn't working label Jul 5, 2023
@marlonrichert
Copy link
Owner

Huh, I weird. I'm indeed able to reproduce this. Strangely enough, though, it doesn't always happen for me. Will have to investigate. Help welcome! 🙂

@marlonrichert marlonrichert added the help wanted Extra attention is needed label Jul 12, 2023
@marlonrichert marlonrichert changed the title Fix bugs in insertion logic $((...)) in history causes history menu to get stuck Jul 12, 2023
@marlonrichert
Copy link
Owner

@PoonKinWang I still haven't found a reliable way to reproduce this. Your example sometimes triggers the bug for me, but not always. It definitely never triggers for me in the test that you included.

Could you try to find a test case that always reliably reproduces the problem?

@marlonrichert marlonrichert added the question Further information is requested label Aug 22, 2023
@Cliffback
Copy link

FWIW, I also get this issue quite frequently when browsing the history. Haven't found a way to reproduce it though.

@Jacobluke-
Copy link

I can reproduce it every time I activate a conda environment and browse the history

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants