[exitstatus jobs time load user#host workdir<dirinfo> (git info) lastcmdtime]user symbol
Example:
┌─ Time ┌─ The current working directory
│ ┌─ System load │ ┌─ Number of files in directory
│ │ │ │ ┌─ Size of files (non-recursive) in directory
│ │ │ │ │
[06:00:00 0.00 user#host dir<4|2.4Mb> 6.3ms]λ ──── The λ symbol denotes non sudo'ed user/session
│ │ │ └─ Process timings
│ │ └─ The hostname of the session
│ └─ The # symbol denotes local session
└─ Logged in user
┌── Exit status of previous command, shows only when $? != 0
[(E:1) 06:00:00 0.00 user#host dir<4|2.4Mb> 6.3ms]λ
┌── Number of running background jobs
[(E:1) bg:2 06:00:00 0.00 user#host dir<4|2.4Mb> 6.3ms]λ
as root ──────────────────────────────┐
[06:00:00 0.00 root@host dir<4|2.4Mb>]μ
└── The λ symbol is replace with μ
When sudo'd
when sudo ──────────────┐
[06:00:00 user@host dir]π
└── The λ symbol is replace with π
WSL with elevated permissions
elevated rights ──────────────────────┐
[06:00:00 0.00 root@host dir<4|2.4Mb>]W*
└── The λ symbol is replace with W*
[06:00:00 0.00 user@host dir<4|2.4Mb>]λ
└─────── The # symbol is replace with @
in screen ┌── window id
[06:00:00 0.00 user@12345.pts-01.host01[1] dir<4|2.4Mb>]λ
└─────────────────┴──── Screen session name
in tmux ┌── tmux pane
[06:00:00 0.00 user@host,tmux-86751[%0] dir<4|2.4Mb>]λ
└────────┴──── tmux session name
[06:00:00 0.00 user#host dir<4|2.4Mb>]λ a '\
→ bcd'
The contents of this portion of the prompt is in the git/git repo.
branch name──────────────────────────────┐ ┌───git status flags
[06:00:00 0.00 root@host dir<4|2.4Mb> (կ master %)]μ
When on screen host is replaced with session name and is underlined.
load = 1 min load avg on *nix/osx/wsl
The prompt can be configured in the ~/.bash_local
configuration file by setting the following environment variables.
The custom prompt can be disabled with the following export.
export DOT_DISABLE_PS1=1
Option | Default | Description |
---|---|---|
PS1_OPT_DAY_START |
8 |
24 hour format for start of the daytime color |
PS1_OPT_DAY_END |
18 |
24 hour format for start of the nighttime color |
PS1_OPT_HIDE_DIR_INFO |
UNSET |
When set, hide segment showing directory file count and size |
PS1_OPT_HIDE_EXEC_TIME |
UNSET |
When set, hide segment showing last command execution time |
PS1_OPT_HIDE_GIT |
UNSET |
When set, hide segment showing git info |
PS1_OPT_HIDE_LOAD |
UNSET |
When set, hide segment showing the 1m load |
PS1_OPT_HIDE_TIME |
UNSET |
When set, hide segment showing the current time |
PS1_OPT_MONOCHROME |
UNSET |
When set, remove all colors |
PS1_OPT_MULTILINE |
UNSET |
When set, force prompt to be 2 lines |
PS1_OPT_NEWLINE_THRESHOLD |
120 |
When the terminal exceeds this many cols, force prompt to be 2 lines |
PS1_OPT_SEGMENT_EXTRA |
UNSET |
Additional segments to be placed after the git segment, but before the cmd execution time, in PS1 string format |
PROMPT_TITLE |
user@host:dir |
Terminal title |
Option | Default | Description |
---|---|---|
PS1_SYMBOL_NO_WRITE_PWD |
* |
Symbol placed after directory name when directory is not writable |
PS1_SYMBOL_GIT |
կ |
Symbol placed before git branch name |
PS1_SYMBOL_SSH |
@ |
Session symbol used between user@hostname when connected over ssh |
PS1_SYMBOL_LOCAL |
# |
Session symbol used between user@hostname on local sessions |
PS1_SYMBOL_USER |
λ |
Symbol to denote a regular user session |
PS1_SYMBOL_ROOT |
μ |
Symbol to denote a root user session |
PS1_SYMBOL_SU |
π |
Symbol to denote a regular user session |
PS1_SYMBOL_WIN_PRIV |
W* |
Symbol to denote an elevated Windows session (Administrator) |
Color values must be defined as ansi color escapes:
PS1_COLOR_WORK_DIRINFO='\[\e[38;5;35m\]'
Load average colors:
0
1
2
3
4
5
6
7
8
9+
See ditig.com/256-colors-cheat-sheet for reference to xterm 256 colors.
user@host [database]→
host[database]>
state[repl]#host [database]>