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

[bug]: Prompt formatting sometimes mangled when typing before a running command finishes #38

Open
AndydeCleyre opened this issue Jul 14, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@AndydeCleyre
Copy link

AndydeCleyre commented Jul 14, 2022

Describe the bug

I've begun a discussion of the issue at agkozak/agkozak-zsh-prompt#39, the prompt with which I see this issue. More details are there, but notably @agkozak wrote:

I only seem to have this problem if I use zdharma-continuum/fast-syntax-highlighting (it doesn't happen with zsh-users/zsh-syntax-highlighting). In fact, I run into it reliably with a mere

source /path/to/agkozak-zsh-prompt.plugin.zsh
source /path/to/fast-syntax-highlighting.plugin.zsh

in my .zshrc, and sleep 1, followed by fast typing, at the command line -- as you pointed out.

Reversing the order in which I load the two plugins seems to help slightly; if any garbling occurs, it is corrected when I switch to vi command mode. Interesting.

I have found that I don't see this problem if I revert 08a4ce9.

Steps to reproduce

% mkdir fsh-demo
% cd fsh-demo
% $EDITOR .zshrc

.zshrc:

if [[ ! -f ${0:h}/.zcomet/bin/zcomet.zsh ]]; then
  command git clone https://github.com/agkozak/zcomet.git ${0:h}/.zcomet/bin
fi

source ${0:h}/.zcomet/bin/zcomet.zsh

. ${0:h}/.zcomet/bin/zcomet.zsh
() {
  local plugin
  for plugin (
    agkozak/agkozak-zsh-prompt
    zdharma-continuum/fast-syntax-highlighting
  ) zcomet load $plugin
}
zcomet compinit

AGKOZAK_BLANK_LINES=1
AGKOZAK_LEFT_PROMPT_ONLY=1
AGKOZAK_PROMPT_DIRTRIM=4
AGKOZAK_PROMPT_DIRTRIM_STRING=…
WORDCHARS=${WORDCHARS//[\/]}
% exec zsh -f
% . ./.zshrc
% sleep 2

While sleep is running, hold down a letter key until after the prompt returns.

You may need to try a few times. You may need to be in tmux session.

Expected behavior

When the prompt appears it should be formatted as usual.

Screenshots and recordings

asciicast

Operating System & Version

linux-gnu | ubuntu | x86_64 | x86_64 | x86_64 x86_64

Zsh version

zsh 5.8.1 (x86_64-ubuntu-linux-gnu)

Terminal emulator

wezterm tmux-256color

If using WSL on Windows, which version of WSL

No response

Additional context

No response

@AndydeCleyre AndydeCleyre added the bug Something isn't working label Jul 14, 2022
AndydeCleyre added a commit to AndydeCleyre/fast-syntax-highlighting that referenced this issue Oct 24, 2023
@ambroisie
Copy link

I'll note that I also see this issue locally.

qosmio pushed a commit to qosmio/fast-syntax-highlighting that referenced this issue Apr 1, 2024
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

2 participants