Customize your Zsh/Bash terminal prompt, from what info you want it to display (Username, Hostname, Symbols, etc), to its Foreground and Background Colors! It's highly recommended you use brighter colors for extra pop!
curl -q -s -LJO "https://github.com/kyletimmermans/shell-color-prompt-tool/releases/download/latest/shell-color-prompt-tool.sh" && chmod +x shell-color-prompt-tool.sh
sudo apt install -y gawk
brew install gawk gnu-sed
sudo port install gawk gsed
Flag | Explanation |
---|---|
--comment-out | Comment out older prompt lines in .zshrc/.bashrc e.g. PROMPT= / PS1= to help prevent conflicting prompt definitions |
--light-mode | Better color contrast for the color picker menu on white/light-colored terminal backgrounds |
--omz | Disables your 'Oh My Zsh' theme if you have one, which could get in the way of applying your new prompt |
--no-extras | Don't automatically add a newline to the start of the prompt and a space to the end of the prompt |
-h/--help/-u/--usage | Show usage/help menu |
-v/--version | Get program version |
-
You don't need to add a newline character at the beginning of your prompt for spacing between actual prompts, one will be added for you. Same with a space after the prompt so there's space between the prompt and inputted commands, one will automatically be added for you. This feature can be disabled with the --no-extras flag
-
Colors may vary from system to system. When using the Custom RGB option, make sure your terminal supports TRUECOLOR (See here)
Don't like the prompt that got saved and want to change it back to its default? |
---|
1. In your Terminal type: vi ~/.zshrc or vi ~/.bashrc |
2. Hit 'i' on your keyboard to start editing the file and remove the line(s) at the bottom of the file, "export PROMPT=etc" (Zsh) or "export PS1=etc" (Bash), that has the comment above it "Added by Shell-Color-Prompt-Tool" |
3. If you used --comment-out or --omz, uncomment your old prompt lines where the line above it says "Commented out by Shell-Color-Prompt-Tool" |
4. Hit 'escape (esc)' on your keyboard and then type :wq and hit enter |
5. Back in your Terminal now, type source ~/.zshrc or source ~/.bashrc and hit enter |
6. Restart your Terminal |
Good as new! |
v1.0: Initial-Relase
v1.1:
-Fixed issue where symbol choices misaligned with actual symbol output, found by @christiankuhtz
-Added period symbol to list of part choices
-Added --version and -v command line flag
-Fixed prompt spacing and wording
v2.0:
-Support for Bash added so its been changed from "Zsh-Color-Prompt-Tool" to "Shell-Color-Prompt-Tool"
-Added option to edit either a standard user prompt (PROMPT) or root prompt (RPROMPT), or both for Zsh
-Any added line(s) will have the comment above it, "Added by Zsh Color Prompt Tool" so the user knows which prompts were generated by the program
-Added --omz, --light-mode, --comment-out, and --no-extras flags
-Added more symbols and colors to chose from in the menus
-Added automatic newline to front of generated prompt and extra space to the end for cleaner prompt and terminal UX
-Messing up a color no longer makes you redo the foreground and background color, just the one that was incorrect
-Fixed issue where colors weren't properly escaped and could cause visual bugs
-Added: -h/--help & -u/--usage flags
v2.5:
-Added Custom RGB color option
-Fixed error messsages showing incorrect range of color options
-Updated and cleaned up help/usage flag output
v2.7:
-Force gawk usage, even on Linux, as there could be multiple awk types installed
-Removed OS-specific commands in --comment-out and --omz functionality
-Everything is using gawk and gsed now
-Fixed some wording in the --help menu