bash: don't use realpath in prompt
This commit is contained in:
@@ -56,15 +56,12 @@ prompt_function() {
|
||||
prompt+="$(whoami)@$(hostname)${RST}:"
|
||||
if root=$(git_root); then
|
||||
# If in a git repository, only print the path relative to the repo root
|
||||
path=$(realpath --relative-to=$root $PWD)
|
||||
path=$(git rev-parse --show-prefix)
|
||||
ref=$(git symbolic-ref --short -q HEAD)
|
||||
if [[ $ref == "" ]]; then
|
||||
ref="${WARN_COLOR}detached${GIT_COLOR}"
|
||||
fi
|
||||
dirty=$(git diff-index --quiet HEAD)
|
||||
if [[ $path == . ]]; then
|
||||
path=""
|
||||
fi
|
||||
prompt+="${GIT_COLOR}[$(basename $root)@${ref}:${DIR_COLOR}${path}${fg}${GIT_COLOR}]${RST}"
|
||||
else
|
||||
# If not in a git repo, print the full path
|
||||
|
||||
Reference in New Issue
Block a user