-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path20_prompt.sh
More file actions
36 lines (30 loc) · 781 Bytes
/
Copy path20_prompt.sh
File metadata and controls
36 lines (30 loc) · 781 Bytes
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
#!bash
if id -nG | grep -qw docker; then
__docker_ps1='\[\033[01;36m\]+docker\[\033[01;32m\]'
else
__docker_ps1=
fi
PS1='\[\033[48;5;053m\033[01;$(( $? ? 31 : 32 ))m\][\u'${__docker_ps1}'@\h\[\033[01;36m\]$(__git_ps1 " ($(git repo-name):%s)")\[\033[01;33m\] \W]\$\[\033[00m\] '
unset __docker_ps1
function __prompt_command_col1 {
local cur_y=
while read -t 0.0001 -r; do :; done
IFS='[;' read -s -r -d'R' -p$'\033[6n' _ _ cur_y
if [[ $cur_y != 1 ]]; then
echo -n $'\033[41m↵\033[m\n'
fi
}
if [[ ! $MC_SID ]]; then
PROMPT_COMMAND=(
"${PROMPT_COMMAND[@]}"
__prompt_command_col1
)
fi
## If this is an xterm set the title to user@host:dir
#case $TERM in
#xterm*|rxvt*)
# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}: ${PWD}\007"'
# ;;
#*)
# ;;
#esac