A simple shell theme
- Exit code visualization
- User with sudo validitity visualization
- Host
- Current directory
- Git branch and changes
Clone this repository to your desired location with git clone --depth=1 https://github.com/robin-pfeiffer/mirage.git
(in this example ~/Projects/github/robin-pfeiffer/mirage
was used).
Source use-mirage.*sh
, based on your shell (Bash, ZSH, etc.), from the location you cloned the repository into, in your shell's .*rc
file to alter PS1
:
# .bashrc
source "$HOME/Projects/github/robin-pfeiffer/mirage/use-mirage.bash"
# .zshrc
source "$HOME/Projects/github/robin-pfeiffer/mirage/use-mirage.zsh
Apply the changes by sourcing your .*rc
file or by restarting your current terminal.
Mirage provides basic configuration of certain features and prompt build-up.
String, default:
\[
Beginning escape character to use for colour blocks. Change this to %{
for ZSH support with export MIRAGE_ESCAPE_CHARACTER_BEGIN="%{
.
String, default:
%}
Ending escape character to use for colour blocks. Change this to %}
for ZSH support with export MIRAGE_ESCAPE_CHARACTER_END="%}
.
true
orfalse
, default:true
When true
shows the validity of sudo
for the current session by colouring the user red instead of blue.
Segmented string, default:
"exit_code user host dir scm"
Add or remove segments from the prompt being used.
Pull the latest changes from this repository with git pull --ff-only
, and source your shell's .*rc
file to apply the changes.
Shell files in this respository are validated with ShellCheck. After making changes to any shell files, run ShellCheck to validate these changes. See ShellCheck for information about installation and usage.
When making changes to the prompt, always make sure that the combination of default segments results in a logical English sentence.
Distributed under MIT License. See LICENSE for more information.