You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ShellColors is an Oh My Zsh plugin that automatically updates your terminal background color based
on the presence of a .shellcolor file in the current directory or one of its parent directories.
The plugin also provides a command interface to set, unset, and manage the .shellcolor file.
Installation
Clone the repository into the custom plugins directory of Oh My Zsh:
Add shellcolors to the list of plugins in your .zshrc file:
plugins=(... shellcolors)
Reload your Zsh configuration or restart your terminal session:
source~/.zshrc
Usage
The plugin automatically updates the terminal background when you change directories. It searches
for a .shellcolor file in the current directory and its parent directories; if none is found, it
uses the default color.
A command interface is provided via the shellcolor command:
Set a random color:
shellcolor set random
This command generates a random low-saturation color, writes it to .shellcolor, and updates
the background.
Set a specific color:
shellcolor set#RRGGBB
Replace #RRGGBB with your desired hexadecimal color code.
Unset the custom color:
shellcolor unset
This command removes the .shellcolor file and reverts to the default background.
Add .shellcolor to .gitignore:
shellcolor gitignore
Reshim (refresh) the background:
shellcolor reshim
Configuration
By default, the plugin uses black (#000000) as the default background color if no .shellcolor
file is found. To change this, set the DEFAULT_SHELLCOLOR environment variable in your .zshrc
file:
Open your .zshrc file:
vim ~/.zshrc
Add the following line with your desired default color:
export DEFAULT_SHELLCOLOR="#yourdefaultcolor"
Save the file and reload your Zsh configuration:
source~/.zshrc
About
Change your terminal background when cd'ing into directories with this zsh plugin.