Set Terminal Focus to Follow the Mouse Cursor in Mac OS X
If you’re coming to Mac OS X from elsewhere in the unix & x11 world, you might be used to the focus of Terminal windows following your mouse cursor. With a little command line magic, we can enable this hidden feature in the Mac OS X Terminal.app too.
This requires the usage of a defaults write string, the syntax is slightly different depending on the version of OS X that is running on the Mac, but it’s supported in virtually every version of the Mac operating system that has the Terminal application.
Enable Mouse Focus for Terminal in Mac OS X Yosemite & Mavericks
Launch the Terminal and enter the following defaults write string:
defaults write com.apple.Terminal FocusFollowsMouse -string YES
You’ll then need to relaunch the Terminal app for the change to take effect.
To disable focus following the cursor, use the following string in modern versions of OS X:
defaults write com.apple.Terminal FocusFollowsMouse -string NO
Again, relaunching the Terminal for changes to take effect.
If you look carefully, you’ll notice the command for Terminal mouse focus in OS X Yosemite is nearly identical to prior versions, except you use a capitalized “T” in “com.apple.Terminal”.
Enable “Focus Follows Mouse” in Terminal for Prior Versions of OS X
Older versions of OS X, like Mountain Lion and Snow Leopard, can use the following terminal command string to enable mouse focus:
defaults write com.apple.terminal FocusFollowsMouse -string YES
You’ll now need to relaunch Terminal.app for changes to take effect.
If you don’t like it, you can disable cursor focus by changing YES to NO and reissuing the command:
defaults write com.apple.terminal FocusFollowsMouse -string NO
Then relaunch Terminal.app for the click-to-focus default setting to be enabled again.
Finally, If you’re wondering what my super awesome background picture is, it’s the 8-bit pixelated aurora wallpaper.