mac iterm2/zsh 复制长文本时等待太长时间

有时候需要粘贴一些比较长的curl命令到终端执行,但是需要等待非常长的时间,于是找到了下面的修改办法。

修改文件~/oh-my-zsh/lib/misc.zsh,将以下代码(大概就在前几行)注释掉后,重新开启终端即可:

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

相关讨论:

  1. https://github.com/zeit/hyper/issues/1276
  2. https://apple.stackexchange.com/questions/312795/zsh-paste-from-the-clipboard-a-command-takes-a-few-second-to-be-write-in-the-ter

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注