Jump to content

Problem with snippets in Zsh


Recommended Posts

I recently changed my shell from bash to zsh. I have lots of snippets for terminal use that ends with a line break. With bash that snippets works fine, I meant, paste the command and execute it (as ends with a line break).

 

The point is that in zsh, doesn't work as I expected. The snippets paste the code and add a line break, but without executing the command. Is there any way of fixing this?

 

Thanks.

Link to comment
20 hours ago, Andrew said:

I'm guessing that this may be zsh interpreting the line break differently

 

It's a paste thing. ZSH is smart enough to recognise when you paste something into the shell and inserts it literally instead of interpreting it as keystrokes (allowing you to insert tabs or newlines into input easily).

 

@jaherran You need to put unset zle_bracketed_paste in your ~/.zshrc file, and then ZSH will treat newlines in your snippets as if you were pressing ↩.

Edited by deanishe
speling
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...