Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Latest commit

 

History

History
108 lines (80 loc) · 4.68 KB

INFO.md

File metadata and controls

108 lines (80 loc) · 4.68 KB
  1. Configuration ================ Promptastic can be customized by editing the file config.py. This file contains 3 elements: theme, patched fonts flag, segments.

1.1. Themes

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.

Default theme: default.py

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!

Light theme: light.py

It's a light-colors theme, best fitting a terminal with a light background, like the default Terminal app in Mac OS X.

Light theme

Custome theme

See CUSTOM-THEMES.md to create a custom theme.

1.2. Patched fonts

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:

No patched fonts

  1. 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.

2.1. User at host

The name of the logged user and the host name. In case the logged user is root the symbol # is used.

User at host segment

2.2. Time

The current time.

Time segment

2.3. Exit code

A cross, only if the last command exited with a failure code.

Exit code segment

2.4. Current directory and read-only

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.

Current directory and read-only segments

2.5. Virtual environment

The name of the active Python virtualenv environment, if any.

Virtual environment segment

2.6. Ssh

A special label in case the user is logged using a SSH connection.

Ssh segment

2.7. Active jobs

The number of active jobs, if any.

Active jobs segment

2.8. Git

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.

Git segment