Zsh Auto-Return on Paste

Author: , 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:

Add the following line to disable bracketed paste mode:

Save the file and reload your configuration to apply the change:

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!

R.I.P. Jimmy Carter

Author: , Posted on Monday, December 30th, 2024 at 4:05:47am

James Earl Carter Jr. (October 1, 1924 – December 29, 2024) served as the 39th president of the United States

R.I.P. Terri Garr

Author: , Posted on Wednesday, October 30th, 2024 at 5:44:00pm

RIP Terri Garr
Born: 1944, Lakewood, OH
Died: October 29, 2024 (age 79 years), Los Angeles, CA

How To Prevent ZenDesk Browser Page From Refreshing Constantly in Safari on MacOS

Author: , Posted on Wednesday, June 12th, 2024 at 7:57:34am

First, enable Developer mode via the Safari menu -> Settings… -> Advanced Tab

Then, disable Cross-Origin Restrictions on the Developer Tab

Finally, be sure to refresh the page you are having issues with.

As always, YMMV!

How To Disable All Automatic WordPress Updates

Author: , Posted on Monday, April 22nd, 2024 at 10:30:48am

To disable all automatic WordPress updates, just edit your WordPress/wp-config.php file and locate the line that says:

/* That's all, stop editing! Happy blogging. */

Add the following line ABOVE that line, then save and exit:

How To Stop WordPress From Using FTP For Updates Or Asking for FTP Credentials

Author: , Posted on Monday, April 22nd, 2024 at 9:57:40am

Edit your WordPress/wp-config.php file and locate the line that says:

/* That's all, stop editing! Happy blogging. */

Add the following three lines ABOVE that line, then save and exit:

Be sure to refresh your browser to get the new settings!

BONUS

To force the use of FTP, change FS_METHOD from direct to ftpext:

From the docs: https://codex.wordpress.org/it:Modificare_wp-config.php

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.

How To Clear All iptables Rules

Author: , Posted on Wednesday, March 20th, 2024 at 10:04:53am

How To Diff Two Files In Vim

Author: , 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.

How To Display All Virtual Hosts Defined for Apache 2

Author: , Posted on Monday, January 29th, 2024 at 4:36:44pm

How To Fix perl: symbol lookup error: undefined symbol: Perl_xs_handshake

Author: , Posted on Thursday, November 9th, 2023 at 10:05:48am

This was caused by having the PERL5LIB environment variable set.