zsh-autosuggestions: Paste fails when using bracketed-paste-magic

On the v0.1.x branch. Commit 6dd93ed.

OSX. El Capitan. Tried with both terminal and iTerm.

zsh version: zsh 5.2 (x86_64-apple-darwin15.0.0) has problem zsh version: zsh 5.0.8 (x86_64-apple-darwin15.0) does not have the problem

When I paste anything to the terminal, nothing visibly happens. Terminal stops accepting an input until I ctrl-c at which point I get a new prompt.

Configuration available at https://github.com/SeanTAllen/dotfiles/blob/master/.zshrc

Problem doesn’t happen when not using oh-my-zsh. I’m going to try to track the issue down. Haven’t had any luck yet.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 32 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Removing this code from oh-my-zsh’s misc.zsh seems to solve the problem:

if [[ $ZSH_VERSION != 5.1.1 ]]; then
  for d in $fpath; do
    if [[ -e "$d/url-quote-magic" ]]; then
      if 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
      break
    fi
  done
fi

I need to test further.

Confirmed the workaround from @louisabraham works.

I’m on the latest versions of everything, as far as I know, but I don’t know how to check ZLE/etc

ZSH: 5.7.1 Oh-My-Zsh: 095d56b5ea44988c83d0be501e70f (September 19 2019)

Until we get to the bottom of who’s at fault here, setting active-widgets to use the dot-prefixed versions of whichever widgets you want to be active should provide a decent workaround.

zstyle ':bracketed-paste-magic' active-widgets '.self-*'

So, for example, here’s a minimal .zshrc that fixes the problem:

autoload -Uz bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-magic
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
zstyle ':bracketed-paste-magic' active-widgets '.self-*'