Useful macOS defaults: Terminal

com.apple.Terminal controls the built-in Terminal app. After changing these, quit and reopen Terminal.

Use UTF-8 only

Make sure Terminal uses UTF-8 encoding everywhere:

defaults write com.apple.Terminal StringEncodings -array 4

The value 4 is the code for UTF-8.

Set the default profile

Set which profile (colour scheme and font settings) Terminal uses for new windows:

defaults write com.apple.Terminal "Default Window Settings" -string "Pro"
defaults write com.apple.Terminal "Startup Window Settings" -string "Pro"

Built-in profiles include Basic, Pro, Grass, Homebrew, Man Page, Novel, Ocean, Red Sands, Silver Aerogel, and Solid Colors.

Enable Secure Keyboard Entry

Stop other apps from reading what you type in Terminal. This blocks keyloggers:

defaults write com.apple.Terminal SecureKeyboardEntry -bool true

You can also turn this on from the Terminal menu. It is worth leaving on.

Show the tab bar

Always show the tab bar, even with a single tab:

defaults write com.apple.Terminal ShowTabBar -bool true

Focus follows mouse

Make Terminal activate whichever window your mouse is over, without clicking:

defaults write com.apple.Terminal FocusFollowsMouse -bool true

This only affects Terminal windows, not other apps.

Turn off marks and bookmarks

Terminal marks the start and end of each command output. If you find these annoying:

defaults write com.apple.Terminal AutoMarkPromptLines -bool false

Line and scrollback settings

Set the number of lines Terminal keeps in the scrollback buffer:

defaults write com.apple.Terminal "Scrollback Limit" -int 10000

Or set unlimited scrollback in the profile settings through Terminal, then Settings, then Profiles, then Window.

Read all current Terminal settings

defaults read com.apple.Terminal

Notes

Terminal profiles store font, colour, cursor, and window size settings. You can export a profile to a .terminal file and share it. Double-clicking a .terminal file imports it.

If you use Terminal for serious work, you might also look at setting up your shell profile (.zshrc for Zsh, the default shell since macOS Catalina).


Enjoyed this post?

Well, you could share the post with others, follow me with RSS Feeds and/or send me a comment via email.


Tags

Category:

Year: