How to customize Terminal on Mac

If you use Terminal on a Mac, you should change the look and some other features of this window for better productivity.

If you use Terminal on a Mac, you should change the look and some other features of this window for better productivity.

  1. 7 commands to manipulate the most basic files and folders everyone must know
  2. How to add color coded terminal code to Microsoft Word
  3. 4 quick access to a Terminal in Linux

How to customize Terminal on Mac

  1. Adjust the Terminal theme
  2. Login command
  3. Change text colors in Terminal Prompt
  4. Change colors and format text in Terminal
  5. Change the window title

Adjust the Terminal theme

You can change the theme for the Terminal window by navigating to Terminal> Preferences . from the Terminal menu bar.

How to customize Terminal on Mac Picture 1How to customize Terminal on Mac Picture 1

In the Preferences window, select the Profiles tab. These options will adjust the appearance of the new Terminal windows.

How to customize Terminal on Mac Picture 2How to customize Terminal on Mac Picture 2

You can adjust the background color, text, text display options, size and font type, ANSI pointer type and color. ANSI color is used when the Terminal command displays the colored output.

You can select one of the available profiles in the menu on the left panel or click the + button at the bottom to create a new profile. These profiles will contain your settings, so you can create a personal profile before adjusting anything.

How to customize Terminal on Mac Picture 3How to customize Terminal on Mac Picture 3

Then set the profile to the default profile by clicking on the Default button at the bottom. All Terminal windows will open in this profile.

How to customize Terminal on Mac Picture 4How to customize Terminal on Mac Picture 4

You can also open the specific profile for the Terminal window by visiting Shell> New Window . This will allow you to select the profile from the new shell.

How to customize Terminal on Mac Picture 5How to customize Terminal on Mac Picture 5

Login command

The terminal can run specific shell commands each time the shell window opens. These commands are assigned to a profile, so different profiles will execute different commands.

Open the Preference window of Terminal from Terminal> Preferences and click on the Shell tab.

How to customize Terminal on Mac Picture 6How to customize Terminal on Mac Picture 6

In the Startup section, check the Run Command box, then type the shell command you want to perform when you start the window. Note, you should also check the Run inside shell box .

How to customize Terminal on Mac Picture 7How to customize Terminal on Mac Picture 7

This installation will automatically save this command to the link profile and run it when opening the shell in that profile. To turn off the start command, uncheck Run command .

Change text colors in Terminal Prompt

You can change the text color in Terminal Prompt by editing ' .bash_profile' . For new users of Terminal Prompt, they will see this text appear when opening a new shell to the left of the text cursor.

How to customize Terminal on Mac Picture 8How to customize Terminal on Mac Picture 8

Open .bash_profile in nano with the following command:

 nano ~ / .bash_profile 

How to customize Terminal on Mac Picture 9How to customize Terminal on Mac Picture 9

How to customize Terminal on Mac Picture 10How to customize Terminal on Mac Picture 10

When .bash_profile opens, you will add a new line starting with:

 export PS1 = 

After the equals sign, we will add ANSI color code. PS1 also contains the Escape sequence, such as the user name, server name, currently working directory, etc. For the screenshot above, we will use the following color rules:

 export PS1 = "[e [38; 5; 051; 48; 5; 233m] u @ h W $ [e [0m]" 

This prompt includes ANSI color codes and escape sequence for users (u), server (h) and currently working directory (w).

Change colors and format text in Terminal

You can change the text formatting format in Terminal through profile settings or directly by typing the shell command. To add text color in a profile, use the text color settings in Terminal> Preferences> Text .

How to customize Terminal on Mac Picture 11How to customize Terminal on Mac Picture 11

To change the color temporarily, use the command below:

 export PS1 = "[e [38; 5; 051; 48; 5; 233m] u @ h W $ [e [0m]" 

You will see results like this:

How to customize Terminal on Mac Picture 12How to customize Terminal on Mac Picture 12

  1. " open the printf string
  2. e exit non-printing characters
  3. [31m is color code for red text
  4. Hello World is a string of characters
  5. e [0m deletes the format so that new text when appearing does not color
  6. n print a new line
  7. " close the printf string

If you want the text to continue to be colored, turn off e [0m . Users can also enable ANSI color codes here. In addition, you can also format the text to be typed in Terminal, which can even cause the text to blink.

 printf "Normal e [5mBlinkn" 

Change the window title

By default, Terminal will display the current working directory, operation process and frame size in the title bar of the Terminal window.

How to customize Terminal on Mac Picture 13How to customize Terminal on Mac Picture 13

However, you can change this window title in the Window tab of Preference. Open Preference and select Window tab.

How to customize Terminal on Mac Picture 14How to customize Terminal on Mac Picture 14

Adjust the settings at the top to change the window title. You can see the changes in the open shells of the edit profile.

I wish you all success!

See more:

  1. Use Terminal on Mac as FTP or SFTP Client
  2. Use commands and some tips for Mac OS X
  3. 10 troubleshooting tips for Mac OS X
4 ★ | 1 Vote