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.
- 7 commands to manipulate the most basic files and folders everyone must know
- How to add color coded terminal code to Microsoft Word
- 4 quick access to a Terminal in Linux
How to customize Terminal on Mac
- Adjust the Terminal theme
- Login command
- Change text colors in Terminal Prompt
- Change colors and format text in Terminal
- 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.
In the Preferences window, select the Profiles tab. These options will adjust the appearance of the new Terminal windows.
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.
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.
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.
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.
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 .
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.
Open .bash_profile in nano with the following command:
nano ~ / .bash_profile
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 .
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:
- " open the printf string
- e exit non-printing characters
- [31m is color code for red text
- Hello World is a string of characters
- e [0m deletes the format so that new text when appearing does not color
- n print a new line
- " 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.
However, you can change this window title in the Window tab of Preference. Open Preference and select Window tab.
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:
- Use Terminal on Mac as FTP or SFTP Client
- Use commands and some tips for Mac OS X
- 10 troubleshooting tips for Mac OS X
You should read it
- How to customize Windows Terminal application
- How to use Terminal on a Mac
- 6 interesting terminal commands on Mac
- Notable changes in Windows Terminal ver 0.11
- How to Change How Often a Mac Screen Saver Changes
- 8 best free Terminal Emulator apps for Android
- How to fix the problem of being unable to enter Terminal in Linux
- Windows Terminal is about to have a retro version with a 'classic' interface.
- Top 5 useful Terminal tips for Mac users
- How to customize Terminal in Ubuntu
- How to delete the user and the machine name in the command prompt on Terminal
- How to use Guake Terminal in Linux