zsh-horizontal-rule-prompt

Put in your ~/.zshrc :

PS1=$'%U${(r:$COLUMNS:: :)}%u'$PS1

src = superuser.com