8

If I paste multiline chunks of text into iTerm2, I always a get mess of output. It seems limited to only some programs running interactively (such as Bash, IRB - Python / VIM work flawlessly). Using Apple's native Terminal, I can paste whatever I want wherever I want - it works. For example, this sample text (full text on pastie.org):

echo Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus.
echo Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit.
echo Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue.
echo Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor.
echo Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor.
echo Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet.
echo Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus.
[snip]

pasted into IRB produces this in iTerm2:

Screenshot iTerm 2

while it produces this in native Terminal:

Screenshot Terminal.app

I am running the latest versions of OSX and iTerm2. What's going wrong here?

  • 4
    I suspect your paste speed may be too high. Try going into Preferences > Advanced and search for "paste". – 0942v8653 Jan 11 '15 at 20:49
  • 3
    Thank you soo much! I couldn't find it in Preferences though. I found it in Edit > Paste Special > Paste Slower. I'm now pasting at 150kB/sec - it's kinda slow, but at least it doesn't bug out on me now. Again, thanks! – Danyel Jan 13 '15 at 22:58
  • "Paste slower" works for me. Thanks! – Sophia Feng Aug 5 '16 at 1:27
5

From docs:

Pastes (both regular and slow) are done by splitting the text to paste into chunks. There is a delay between the transmission of each chunk. To change the speed that "paste" pastes at:

defaults write com.googlecode.iterm2 QuickPasteBytesPerCall -int 1024
defaults write com.googlecode.iterm2 QuickPasteDelayBetweenCalls -float 0.01

To change the speed that "paste slowly" pastes at:

defaults write com.googlecode.iterm2 SlowPasteBytesPerCall -int 16
defaults write com.googlecode.iterm2 SlowPasteDelayBetweenCalls -float 0.125
  • Note that this requires to close/reopen Iterm2 as mentionned in the link. – Cyril Duchon-Doris Feb 20 at 10:18
0

In my case it was caused by the fact that I am using zsh-autosuggestions plugin for ZSH.

What solved this was adding this line to my .zshrc:

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

as suggested in this comment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .