Author: erics, Posted on Friday, January 17th, 2025 at 9:20:32am
Have you ever found yourself frustrated when copying and pasting commands in the Apple terminal no longer behaves as expected? If you used to work with Bash on older macOS versions, you might recall that pasting a command into the terminal automatically executed it—no extra steps required. However, with the switch to Zsh as the default shell in newer macOS versions, this behavior has changed. Now, pasting doesn’t automatically press return, and that can feel like an unnecessary hurdle.
The reason for this change lies in how Zsh and terminal emulators handle pasted content. Specifically, it’s due to a feature called bracketed paste mode, which prevents commands from executing immediately upon being pasted. While this feature is useful for security and preventing accidental execution, it’s not always convenient. Fortunately, you can adjust Zsh to restore the old behavior and automatically press return after a paste.
If you’d like to go back to the simpler behavior of pasting and executing commands automatically, you can disable bracketed paste mode. This reverts Zsh to behave more like Bash in this regard.
Here’s how to disable Bracketed Paste Mode:
Open your .zshrc file in a text editor:
1
vi~/.zshrc
Add the following line to disable bracketed paste mode:
1
unset zle_bracketed_paste
Save the file and reload your configuration to apply the change:
1
source~/.zshrc
With this change, Zsh will no longer block the automatic execution of pasted commands.
By following these steps, you can bring back the seamless pasting experience you enjoyed with Bash. Whether you’re writing scripts, testing commands, or just trying to save time, this small adjustment can make a big difference in your workflow. Happy coding!
FS_METHOD forces the filesystem method. It should only be “direct”, “ssh2”, “ftpext”, or “ftpsockets”. Generally, You should only change this if you are experiencing update problems, If you change it, and it doesnt help change it back/remove it, Under most circumstances, setting it to ‘ftpsockets’ will work if the automatically chosen method does not.
(Primary Preference) “direct” forces it to use Direct File I/O requests from within PHP, this is fraught with opening up security issues on poorly configured hosts, This is chosen automatically when appropriate.
(Secondary Preference) “ssh2” is to force the usage of the SSH PHP Extension if installed
(3rd Preference) “ftpext” is to force the usage of the FTP PHP Extension for FTP Access, and finally
(4th Preference) “ftpsockets” utilises the PHP Sockets Class for FTP Access.
Author: erics, Posted on Monday, February 5th, 2024 at 4:10:35pm
shell> vimdiff file1 file2
~OR~
shell> vim file1 file2
Create a vertical split window: Control-w v
Enable visual diff on the left side: :diffthis
Move the cursor to the right side buffer: Control-w Right-arrow
Enable visual diff on the left side: :diffthis
You should now see the differences highlighted on both sides.