- Configuration
================
Promptastic can be customized by editing the file
config.py
. This file contains 3 elements: theme, patched fonts flag, segments.
Themes determine the set of colors used in the prompt. There are a bunch of themes already
stored in the themes
folder. New themes can be easily created copying one of those
already existent.
It's a dark-colors theme, best fitting a terminal with a dark background. All screenshots in the next sections are based on this theme. It's my favorite!
It's a light-colors theme, best fitting a terminal with a light background, like the default Terminal app in Mac OS X.
See CUSTOM-THEMES.md to create a custom theme.
Patched powerline-fonts can be used for better-looking glyphs. My favorite is Sauce Code Powerline Light . See INSTALL.md in order to install patched fonts.
All screenshots in the next sections were taken in terminals using Sauce Code Powerline Light patched font. A terminal with no patched fonts looks like this:
- Segments
===========
Promptastic creates the flavored prompt appending several segments.
Any segment can be enabled/disabled in the
config.py
file.
The following sections list all the segments and their details.
The name of the logged user and the host name. In case the logged user is root
the symbol #
is used.
The current time.
A cross, only if the last command exited with a failure code.
The path of the current directory. A padlock is added in case the logged user has no write permission on the directory. A warning message is shown in case the current directory is not a valid path.
The name of the active Python virtualenv environment, if any.
A special label in case the user is logged using a SSH connection.
The number of active jobs, if any.
If the current directory is a Git repository, the name of the current branch is displayed and:
- the color of the segment reveals the general status of the working directory:
- green (e.g. 2nd prompt line in the screenshot) when the working directory is clean;
- pink (e.g. 3rd prompt line in the screenshot) when the working directory is dirty (untracked files or changes not staged for commit);
- orange (e.g. 4th prompt line in the screenshot) when all changes are staged for commit;
- glyphs are added to manifest detailed statuses:
- an umbrella (e.g. 3rd prompt line in the screenshot) when there are untracked files;
- a cloud (e.g. 5th prompt line in the screenshot) when there are changes not staged for commit, but no untracked files;
- a sun (e.g. 4th prompt line in the screenshot) when all changes are staged for commit;
- a number n plus a arrow right/left oriented (e.g. 6th and 8th prompt lines in the screenshot) when the current branch is n commits ahead/behind origin.