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
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
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.
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.
Alternative 3rd party Terminal apps such as iTerm2 among others can do this among many other useful features.
I use iTerm2 and set the Preferences -> Appearance -> General -> Theme to "Minimal".
I also apply a custom profile using the One Dark color scheme.
It always stays dark no matter if macOS is in Light or Dark mode.
You don’t.
Note: The minimal theme is what allows for the dark titlebar on iTerm2. Otherwise it will be white in Light mode. Black in Dark mode.
How do I change Terminal to be permanently dark mode?