File tree Expand file tree Collapse file tree 2 files changed +46
-5
lines changed Expand file tree Collapse file tree 2 files changed +46
-5
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ Requirements
20
20
* bash
21
21
22
22
23
- Installation
24
- ============
23
+ Installation & Usage
24
+ ====================
25
25
26
26
1 . Save [ ` ps1.py ` ] ( ps1.py ) to your computer somewhere (I put my copy at
27
27
` ~/share/ps1.py ` )
@@ -30,7 +30,8 @@ Installation
30
30
31
31
PROMPT_COMMAND="$PROMPT_COMMAND"'; PS1="$(/usr/bin/python3 ~/share/ps1.py "${PS1_GIT:-}")"'
32
32
33
- Replace ` ~/share/ps1.py ` with the location you saved ` ps1.py ` at as
33
+ Replace ` /usr/bin/python3 ` with the path to your Python 3 interpreter, and
34
+ replace ` ~/share/ps1.py ` with the location you saved ` ps1.py ` at as
34
35
appropriate.
35
36
36
37
3 . Open a new shell
@@ -39,7 +40,7 @@ Installation
39
40
40
41
5 . If the Git integration causes you trouble (either because something breaks
41
42
or just because it's taking too long to run), it can be temporarily disabled
42
- by setting ` PS1_GIT=off ` in bash.
43
+ by running ` PS1_GIT=off ` in bash.
43
44
44
45
45
46
Git Status Symbols
@@ -62,7 +63,7 @@ relevant. From left to right, the symbols are:
62
63
working tree:
63
64
- Green: There are staged changes
64
65
- Red: There are unstaged changes
65
- - Light yellow: There are both staged and unstaged changes
66
+ - Bold light yellow: There are both staged and unstaged changes
66
67
- ` + ` (bold red) — Indicates there are untracked files in the working tree
67
68
- ` [STATE] ` (magenta) — Shows what activity Git is currently in the middle of,
68
69
if any:
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/python3
2
+ """
3
+ Yet another bash prompt script
4
+
5
+ Here we have yet another script for Git-aware customization of the bash command
6
+ prompt. Unlike all the other scripts, I wrote this one, so it's better.
7
+
8
+ Features:
9
+
10
+ - lets you know if you have mail in ``$MAIL``
11
+ - shows chroot and `virtualenv <https://virtualenv.pypa.io>`_ prompt prefixes
12
+ - automatically truncates the current directory path if it gets too long
13
+ - shows the status of the current Git repository (see below)
14
+ - thoroughly documented and easily customizable
15
+
16
+ Visit <https://github.com/jwodder/ps1.py> for more information.
17
+
18
+
19
+ Installation & Usage
20
+ ====================
21
+
22
+ 1. Save this script to your computer somewhere (I put my copy at
23
+ ``~/share/ps1.py``)
24
+
25
+ 2. Add the following line to the end of your ``~/.bashrc``::
26
+
27
+ PROMPT_COMMAND="$PROMPT_COMMAND"'; PS1="$(/usr/bin/python3 ~/share/ps1.py "${PS1_GIT:-}")"'
28
+
29
+ Replace ``/usr/bin/python3`` with the path to your Python 3 interpreter,
30
+ and replace ``~/share/ps1.py`` with the location you saved ``ps1.py`` at as
31
+ appropriate.
32
+
33
+ 3. Open a new shell
34
+
35
+ 4. Enjoy!
36
+
37
+ 5. If the Git integration causes you trouble (either because something breaks
38
+ or just because it's taking too long to run), it can be temporarily disabled
39
+ by running ``PS1_GIT=off`` in bash.
40
+ """
41
+
2
42
from enum import Enum
3
43
import os
4
44
from pathlib import Path , PurePath
You can’t perform that action at this time.
0 commit comments