jaherran Posted July 18, 2019 Share Posted July 18, 2019 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
Andrew Posted July 23, 2019 Share Posted July 23, 2019 @jaherran I'm guessing that this may be zsh interpreting the line break differently, similar to using return vs. alt+return. In Terminal/bash, this doesn't make any difference, you may be able to configure zsh to do the same? Link to comment
jaherran Posted July 23, 2019 Author Share Posted July 23, 2019 No idea. I tried to find out how, but couldn't found a solution that works. Link to comment
deanishe Posted July 23, 2019 Share Posted July 23, 2019 (edited) 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 July 24, 2019 by deanishe speling Andrew 1 Link to comment
jaherran Posted July 24, 2019 Author Share Posted July 24, 2019 (edited) Thanks a lot @deanishe. It works like a charm! Edited July 24, 2019 by jaherran Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now