Getting strange characters when pasting into my iterm2 terminal

I am using iterm2 v 3.0.15 on Mac Sierra. I am having problems cutting and pasting from other places (like text on a webpage) into my terminal. For example, I select text from a web page, press Command + C, go to terminal, and then press Command + V, I get

localhost:myproject nataliab$ 00~on the next01~

      

Notice the "00 ~" and "01 ~" before and after my text. I don't see these characters when I cut and paste them into a text editor or elsewhere. How can I remove these special characters when I cut and paste into my iterm2 terminal?

+18


source to share


9 replies


Solution in my case:



Paste printf '\e[?2004l'

into iTerm2 terminal and click enter

after that.

+18


source


I had the same problem and was unable to figure out why this problem is happening, but closing iTerm2 with Command + Q

and reopening the problem fixed the problem.



+8


source


In a terminal window, type reset

and hit enter. Now try to paste the content into the terminal, it will work correctly.

+6


source


I recently started to encounter this behavior in iterm2 as well. Killing and restarting the session fixes it, but loses the context. I found this comment about parenthesized insert mode and tried printf '\e[?2004h'

to exit parenthesis insert mode and restore terminal and it worked great for me.

+4


source


$ printf '\ e [? 2004l '

This solved my problem. but the funny thing is when I pasted the above command, it is also pasted like below

00 ~ printf '\ e [? 2004l'01 ~

+3


source


Adding set t_BE=

to .vimrc to turn off parenthesis insertion mode should fix that. you can call: https://gitlab.com/gnachman/iterm2/issues/5698

+2


source


I think this is a parenthesized problem

  1. Edit -> Paste Special -> Extended Paste

  2. Uncheck "Parenthetical Paste Mode"

  3. Restart the terminal

+2


source


I can't guarantee the terms of this fix because I've been messing around with the solutions above for a while, but the following problem was resolved for me:

iTerm2 -> Settings -> Keys -> double click to edit the target -> ⌘v

In the "Speed" section, set the "Cartridge size" to 256B and the "Interchanck" delay to 100ms.

0


source


To permanently disable Insert Bracketing mode, open Settings, search for Bracketing, uncheck Terminal may enable bracketing.

0


source







All Articles