-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash_prompt
More file actions
40 lines (32 loc) · 1.13 KB
/
bash_prompt
File metadata and controls
40 lines (32 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
# Replaced default PS1.
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# Use short_prompt?
short_prompt=true
# Whenever $force_color_prompt is set 'yes', it still colored.
PS1='${debian_chroot:+($debian_chroot)}' # debian_chroot. I have no idea what is this.
# username and hostname
[ "$TERM" = "linux" ] || [ ! "$short_prompt" = true ] && PS1+='\[\033[01;31m\]\u@\h\[\033[00m\] '
PS1+='\[\033[01;34m\]\W\[\033[00m\] ' # current location
PS1+='$(__git_ps1 "\[\033[01;33m\][%s]\[\033[00m\] ")' # git_prompt
PS1+='\$ ' # END
unset short_prompt
# Git prompt config. Keep them `true`
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWCOLORHINTS=true
GIT_PS1_UNTRACKEDFILES=true
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
#PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac