How do I change Terminal to be permanently dark mode?

I have it so it changes theme at night but I want it to be dark at all times in Terminal, how would I do that?

MacBook Air 13″, macOS 11.5

Posted on Sep 13, 2021 11:43 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 13, 2021 12:03 PM

In Terminal Preferences, you can set it to have a dark background, color prompt, etc. I suggest you create a new Terminal profile (I called mine IR_Black, and make the default profile. Here is mine:



Optionally, you can create a colorful Terminal prompt for that black background. I used tput to assign colors to variables in my ~/.zshrc and ~/.bashrc files:


TPUT="/usr/bin/tput"
Bluebld="$(${TPUT} bold; ${TPUT} setaf 63)"
White="$(${TPUT} bold; ${TPUT} setaf 15)"
Green="$(${TPUT} bold; ${TPUT} setaf 42)"
Normal="$(${TPUT} sgr0)"



and to prevent VPN DNS servers changing my prompt hostname, I did the following, again in either dot file:


# don't want VPN DNS changing my hostname
MyHost="$(networksetup -getcomputername)"


and finally the PS1 prompt invocation:


~/.zshrc

PS1="%{${Green}%}${MyHost}: %~ %% %{${White}%}"


~/.bashrc

export PS1='\[$Bluebld\]$MyHost: \w \[$Green\]$ \[$White\]'



You can download a zsh/bash compatible shell script that lists all 256 integer color values for Terminal prompt customization using tput. This script works on Big Sur 11.5.2.

4 replies
Question marked as Top-ranking reply

Sep 13, 2021 12:03 PM in response to NintendoAndAppleFan

In Terminal Preferences, you can set it to have a dark background, color prompt, etc. I suggest you create a new Terminal profile (I called mine IR_Black, and make the default profile. Here is mine:



Optionally, you can create a colorful Terminal prompt for that black background. I used tput to assign colors to variables in my ~/.zshrc and ~/.bashrc files:


TPUT="/usr/bin/tput"
Bluebld="$(${TPUT} bold; ${TPUT} setaf 63)"
White="$(${TPUT} bold; ${TPUT} setaf 15)"
Green="$(${TPUT} bold; ${TPUT} setaf 42)"
Normal="$(${TPUT} sgr0)"



and to prevent VPN DNS servers changing my prompt hostname, I did the following, again in either dot file:


# don't want VPN DNS changing my hostname
MyHost="$(networksetup -getcomputername)"


and finally the PS1 prompt invocation:


~/.zshrc

PS1="%{${Green}%}${MyHost}: %~ %% %{${White}%}"


~/.bashrc

export PS1='\[$Bluebld\]$MyHost: \w \[$Green\]$ \[$White\]'



You can download a zsh/bash compatible shell script that lists all 256 integer color values for Terminal prompt customization using tput. This script works on Big Sur 11.5.2.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I change Terminal to be permanently dark mode?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.