0

I have configured PS1 and made the entire prompt bold

.zshrc contains as follows

PS1="%{$fg_bold[yellow]%}%n@%m %{$fg[blue]%}%~ \$ %{$reset_color%}%{$fg_bold[white]%}"
preexec() { printf "\e[1m"; }

Whatever I type in after the prompt is appearing bold only when I load from the buffer. For example, as shown here me typing echo "this is text" does not appear in bold.

I am on Ubuntu 18.04 and am trying to move to zsh.

Rvdixit23
  • 193
  • 9

1 Answers1

1

The Zshell Line Editor (zle) lets you format the command buffer.

PS1='%F{yellow}B%n@%m %F{blue}%~ \$ %f%b'  # simplified prompt

zle_highlight=(default:bold,fg=white)

More information about how to use zle_highlight can be found in man zshzle.


Based on the linked screenshot, it looks like something is already formatting your the command input; you may want to run print $zle_highlight first to see its current value and modify it accordingly, or research your existing configuration for the source of the current colorization.

chepner
  • 497,756
  • 71
  • 530
  • 681
  • It turns out that the plugin zsh-syntax-highlighting also modifies this variable. Realised this after setting zle_highlight and seeing no change. Adding this line to .zshrc did the job. ZSH_HIGHLIGHT_STYLES[builtin]='fg=yourColor,bold' – Rvdixit23 Jun 27 '20 at 10:42