- search in your
source $ZSH/oh-my-zsh.shand prepend this:
- Open iTerm 2 Preferences, Profile Tab, Terminal Tab, untick this: Terminal may enable paste bracketing
This has been an annoyance for months or years now, and I never got around to fix it, since it was never too annoying, but rather just annoying. Let’s fix things! What exactly?
I’m an oh-my-zsh user and when you copy and paste things into the terminal, it’ll automatically put backslashes in front of various characters to make them work when executing the command, this usually happens when you’re pasting a URL into your terminal when you want to test something with curl for example.
Assume I have a URL and want to debug the output using curl. Naturally, I go ahead, copy the URL from my browser and paste it into my terminal. Now with oh-my-zsh enabled, the following happens:
this is how it’ll look like in my terminal:
Depending on the URL, the tool, the script, whatever, you’ll get weird error messages that it couldn’t parse the input because of the backslashes.
fix for oh-my-zsh
this is actually just part 1: in order to fix this behavior for oh-my-zsh, you need to open your
~/.zshrc file and put this in front of
so it should look like this:
DISABLE_MAGIC_FUNCTIONS=true source $ZSH/oh-my-zsh.sh
Next, either run
source ~/.zshrc to apply changes or open a new terminal session/window/tab. Unfortunately, this is only half of the fix, at least if you’re also using iTerm 2.
fix for iTerm 2
- open up your iTerm 2 Settings
- open the Profile tab
- open the Terminal (sub)-tab
- untick Terminal may enable paste bracketing
see also this screenshot:
as usual, thanks to the people on stack overflow