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

ZVM_READKEY_ENGINE_NEX causing extremly slow paste #294

Open
3 tasks done
billkewl opened this issue Sep 15, 2024 · 0 comments
Open
3 tasks done

ZVM_READKEY_ENGINE_NEX causing extremly slow paste #294

billkewl opened this issue Sep 15, 2024 · 0 comments

Comments

@billkewl
Copy link

General information

  • Terminal program: Apple_Terminal 453 (xterm-256color)
  • Operating system: macOS 14.6.1 (23G93)
  • ZSH framework:
  • ZSH version: zsh 5.9 (x86_64-apple-darwin23.0)
  • ZVM version: zsh-vi-mode 0.11.0

Basic examination

  • I have read through the README page
  • I have the latest version of zsh-vi-mode
  • I have tested with another terminal program

Problem description

When readkey engine set to ZVM_READKEY_ENGINE_NEX, current default engine, pasting in insert mode takes forever to finish. At first I thought it was zsh-vi-mode conflict with fast-syntax-highlighting, zsh-autosuggestions and zsh-history-substring-search. But after some trial and errors it turns out that the culprit is ZVM_READKEY_ENGINE_NEX

Changing ZVM_READKEY_ENGINE=$ZVM_READKEY_ENGINE_ZLE temporarily fixed the issue.
This issue only happens on macOS. On Arch Linux there isn't such issue when I use the same .zshrc

Here's an excerpt from my .zshrc

source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
ZSH_AUTOSUGGEST_IGNORE_WIDGETS+=(backward-kill-word kill-word)

source /opt/homebrew/opt/zsh-fast-syntax-highlighting/share/zsh-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
source /opt/homebrew/share/zsh-history-substring-search/zsh-history-substring-search.zsh

function zvm_config() {
  ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
  ZVM_VI_INSERT_ESCAPE_BINDKEY=jj
  ZVM_VI_VISUAL_ESCAPE_BINDKEY=jj
  ZVM_READKEY_ENGINE=$ZVM_READKEY_ENGINE_DEFAULT
  ZVM_INIT_MODE=sourcing
}
source $(brew --prefix)/opt/zsh-vi-mode/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh

autoload -Uz is-at-least
if [[ ${ZSH_VERSION} != 5.1.1 && ${TERM} != "dumb" ]]; then
  if is-at-least 5.2; then
    autoload -Uz bracketed-paste-url-magic
    zle -N bracketed-paste bracketed-paste-url-magic
  elif is-at-least 5.1; then
    autoload -Uz bracketed-paste-magic
    zle -N bracketed-paste bracketed-paste-magic
  fi
  autoload -Uz url-quote-magic
  zle -N self-insert url-quote-magic
fi

Reproduction steps

  1. Open zsh and enter insert mode
  2. Paste a long line such as curl request
  3. Wait until paste finishes

Expected behavior

Immediately finished paste on ZVM_READKEY_ENGINE_NEX just like on Arch Linux

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

No branches or pull requests

1 participant