A fast, simple bash prompt.
A fast, simple bash prompt.
$ cd $WHERE_YOU_KEEP_GITHUB_REPOS
$ git clone https://github.com/skeswa/prompt
$ cd prompt
$ make install
$ . ~/.bashrc
~/some/really/long/path/like/this/you/might/see
→ ~/some/really/l/p/l/t/y/might/see
)bash
installed at version 3.0.0
or highergit
installed at version 2.0.0
or higher$ cd $WHERE_YOU_KEEP_GITHUB_REPOS/prompt
$ git pull
$ . ~/.bashrc
Colors can be customized by editing the following environment variables:
PROMPT_PWD_COLOR
- Color for the current working directory (e.g. ~/a/b/c
), defaults to 38;5;43
PROMPT_GIT_COLOR
- Color for the current git branch/ref (e.g. :master
), defaults to 38;5;105
PROMPT_USERHOST_COLOR
- Color for the current user session info (e.g. corey@desktop
), defaults to 38;5;39
PROMPT_DOLLAR_COLOR
- Color for the dollar sign, defaults to 38;5;255
PROMPT_ERROR_COLOR
- Color for the dollar sign when the previous command failed, defaults to 38;5;204
To come up with your own colors, take a look at the reference graphic below from wikipedia:
You can override the host name of your prompt (the desktop
part of corey@desktop
) by setting the PROMPT_HOST_NAME
environment variable. For example, if your desired prompt is corey@inthehouse
, then you might stick this in your ~/.bashrc
before the . ~/.prompt/prompt.bash
:
export PROMPT_HOST_NAME='inthehouse'
bash provides a special set of variables for your prompts. PS1
is the one used by default. The install script adds a command to ~/.bashrc
, a file that is run every time a new terminal opens. Inside of the new command, we run our script and set your PS1
which runs some git
commands to determine its current state and outputs them as a string.
Linux and Mac OSX are supported platforms.
Try on Windows at your own peril.
To uninstall prompt
, perform the following steps:
. ~/.prompt/prompt.bash
and . ~/.prompt/git-completion.bash
from ~/.bashrc
~/.prompt
(e.g. rm ~/.prompt
)prompt
was originally installed. ~/.bashrc
invocation to ~/.bash_profile
, ~/.bash_login
, or ~/.profile
Copyright (c) 2017 Sandile Keswa
Licensed under the MIT license.