Skip to content

Commit

Permalink
prompt: defaults, fix multiline, dir basename
Browse files Browse the repository at this point in the history
  • Loading branch information
boyska committed Jun 16, 2015
1 parent 8ca9e2f commit b39ef4a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions config/includes.chroot/etc/bash_completion.d/prompt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
promptunicode=1

promptunicode=${promptunicode:-1}
freeptoprompt() {
local exit_=$?
if [[ $promptunicode -eq 1 ]]; then
local ok_symbol=$'\u2713'
local no_symbol=$'\u2717'
local ok=$'\u2713'
local no=$'\u2717'
else
local ok_symbol="."
local no_symbol="x"
local ok="."
local no="x"
fi
local LGREEN="\[\033[1;32m\]"
local LRED="\[\033[1;31m\]"
local CYAN='\e[0;36m'
local CYAN="\[\033[0;36m\]"
local WHITE="\[\033[1;37m\]"
local RESET="\[\033[0;00m\]"

local user_color
local last
if [[ $EUID -eq 0 ]]; then
Expand All @@ -22,11 +22,11 @@ freeptoprompt() {
user_color="$WHITE"
fi
if [[ $exit_ -eq 0 ]]; then
last="${LGREEN}$ok_symbol$RESET"
last="${LGREEN}$ok$RESET"
else
last="${LRED}$no_symbol:$exit_$RESET"
last="${LRED}${no}:${exit_}$RESET"
fi
PS1="$user_color\u$RESET [$CYAN\w$RESET]$last $user_color\$${RESET} "
PS1="$user_color\u$RESET [$CYAN\W$RESET]$last $user_color\$${RESET} "
}
PROMPT_COMMAND=freeptoprompt

Expand Down

0 comments on commit b39ef4a

Please sign in to comment.