blob: 74f99fdd270d768e0cd8a99f860a8f57217abaea (
plain)
1 Nullprompt README
2 =================
3
4 Nullprompt is a very simple and barely customizable PS1 generator, written for
5 `nullspoon`. As it was written for one person in mind, it does only what is
6 wanted by its author. If you want it to do something different, please feel
7 free to fork (GPLv3 of course), or submit a request for another feature or a
8 pull request implementing it. Nothing extravagant though please. The purpose
9 of this is to have a _very_ fast but robust enough PS1 while using reasonable
10 defaults. Execution time should remain somewhere under 20 milliseconds.
11
12 What does nullprompt do?
13 ------------------------
14
15 At this time, nullprompt outputs essentially two different modes: normal, and git.
16
17 If you are anywhere on the filesystem that _isn't_ a git repo, you should see a
18 PS1 that looks something like `retval user@host cwd$ `. The retval is color
19 coded: success / 0 is green, error / 1 is red, and anything above that is
20 yellow.
21
22 If you are within a git repo, you should see a PS1 like `retval [branch]
23 reponame/sub/path$ `. Note that if the sub path is very long, it will be
24 truncated, with an ellipse in the middle of the path to indicate truncation.
25
26
27 Options
28 -------
29
30 Nullprompt supports one command line option: `-v,--version`. It prints the
31 version. :)
32
33
34 Usage
35 -----
36
37 To use this, set the following int your `.bashrc` file.
38
39 ```
40 get_prompt() {
41 retval=$?
42 PS1="$(RETVAL=${retval} nullprompt || printf '$ ')"
43 }
44
45 export PROMPT_COMMAND=get_prompt
46 ```
|