splits
This commit is contained in:
parent
ba3b90366b
commit
ce576b7a99
1 changed files with 20 additions and 5 deletions
|
@ -55,26 +55,41 @@ ps1() {
|
|||
local path="${PWD}"
|
||||
local user="${USER}"
|
||||
local view="└ "
|
||||
# code
|
||||
if [ "${code}" -ne 0 ]; then
|
||||
view="${view}${SH_GREEN}"
|
||||
else
|
||||
view="${view}${SH_RED}"
|
||||
fi
|
||||
view="${view}${code}${SH_DEFAULT} @ ${SH_BROWN}${date}${SH_DEFAULT}"
|
||||
view="${view}${code}"
|
||||
# date
|
||||
view="${view}${SH_DEFAULT} @ "
|
||||
view="${view}${SH_BROWN}${date}"
|
||||
# git
|
||||
if [ "$(type -t __git_ps1)" = "function" ]; then
|
||||
git="$(__git_ps1)"
|
||||
if [ -n "${git}" ]; then
|
||||
view="${view} –${SH_MAGENTA}${git}${SH_DEFAULT}"
|
||||
view="${view}${SH_DEFAULT} –${SH_MAGENTA}${git}"
|
||||
fi
|
||||
fi
|
||||
view="${view}\n${SH_CYAN}${path}${SH_DEFAULT}"
|
||||
view="${view}\n┌ "
|
||||
# new
|
||||
view="${view}\n"
|
||||
# path
|
||||
view="${view}${SH_CYAN}${path}"
|
||||
# new
|
||||
view="${view}\n"
|
||||
# frame
|
||||
view="${view}┌ "
|
||||
# user
|
||||
if [ "${id}" -eq 0 ]; then
|
||||
view="${view}${SH_GREEN}"
|
||||
else
|
||||
view="${view}${SH_RED}"
|
||||
fi
|
||||
view="${view}${user}${SH_DEFAULT} @ ${SH_BROWN}${host}${SH_DEFAULT}"
|
||||
view="${view}${user}"
|
||||
# host
|
||||
view="${view}${SH_DEFAULT} @ "
|
||||
view="${view}${SH_BROWN}${host}${SH_DEFAULT}"
|
||||
echo -e "${view}\n${PS2}"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue