Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(oh-my-)zsh's filename completion changes current font

Tags:

zsh

fonts

I have just installed the (awesome) oh-my-zsh package to customize my zsh prompt, but I've hit this weird problem:

If I use autocompletion on a command name (e.g. sou<TAB> -> source), everything works as intended. However, if I use autocompletion on a file name (e.g. source .zshr<TAB> -> source .zshrc), the font changes to grey bold for the whole command. I do use bold in my PROMPT as well as colors, but not gray, so I don't know where that color code comes from; also the fact that it only happens when completing a file name puzzles me.

Here are my PROMPT and RPROMPT (inspired from Steve Losh's prose theme).

PROMPT='
%B%F{208}%n%{$reset_color%}%{$fg_bold[white]%}@%B%F{039}$(box_name)
%{$reset_color%}:%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}
$(hg_prompt_info)$(git_prompt_info)
$(virtualenv_info)$(prompt_char) '

RPROMPT='${return_status}%{$reset_color%}[%t]'

Thanks in advance.

like image 500
antony Avatar asked Jun 27 '11 17:06

antony


1 Answers

Actually, the solution was rather simple: color&weight changes introduces by %B and %F must be closed by %b and %f, not by $reset_color... that's all.

like image 155
antony Avatar answered Dec 01 '22 09:12

antony