Fix zsh auto-complete PROMPT spacing issue

This commit is contained in:
Tommy Harris 2021-02-22 14:40:26 -07:00
parent 848a7ee4ed
commit f9705de475
Signed by: tobraha
GPG Key ID: 93769A4F97AE33E9
1 changed files with 4 additions and 4 deletions

View File

@ -42,7 +42,7 @@ esac
# Special Powerline characters
() {
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
local LC_ALL="en_US.utf8" LC_CTYPE="en_US.utf8"
# NOTE: This segment separator character is correct. In 2012, Powerline changed
# the code points they use for their special characters. This is the new code point.
# If this is not working for you, you probably have an old version of the
@ -64,9 +64,9 @@ prompt_segment() {
[[ -n $1 ]] && bg="%K{$1}" || bg="%k"
[[ -n $2 ]] && fg="%F{$2}" || fg="%f"
if [[ $CURRENT_BG != 'NONE' && $1 != $CURRENT_BG ]]; then
echo -n "%{$bg%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR%{$fg%} "
echo -n "%{$bg%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR%{$fg%}"
else
echo -n "%{$bg%}%{$fg%} "
echo -n "%{$bg%}%{$fg%}"
fi
CURRENT_BG=$1
[[ -n $3 ]] && echo -n $3
@ -87,7 +87,7 @@ prompt_context() {
prompt_segment
#printf to kill the mystery space...?
printf "\b%s" "%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}%b"
echo -n "%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}%b"
}
# Git: branch/detached head, dirty status