🐛 fix in prompt

pull/1343/head
tbhaxor 2019-03-14 13:11:04 +05:30
parent 7a88b6524e
commit 9576b878c8
No known key found for this signature in database
GPG Key ID: 2CE3F4D1406EED1A
1 changed files with 5 additions and 4 deletions

View File

@ -9,20 +9,20 @@ function parse_git_branch_no_color() {
echo -e "$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/')" echo -e "$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/')"
} }
function promp() { function prompt() {
# If not running interactively, don't do anything # If not running interactively, don't do anything
[[ $- != *i* ]] && return [[ $- != *i* ]] && return
force_color_prompt=yes local force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48 # We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.) # a case would tend to support setf rather than setaf.)
color_prompt=yes local color_prompt=yes
else else
color_prompt= local color_prompt=
fi fi
fi fi
@ -34,3 +34,4 @@ function promp() {
fi fi
} }
safe_append_prompt_command prompt