Re: Changing PSI and PS0 leads to four characters at beginning of user i
From:
Greg Wooledge
Subject:
Re: Changing PSI and PS0 leads to four characters at beginning of user input
Date:
Sun, 4 Jul 2021 15:05:11 -0400
On Sun, Jul 04, 2021 at 09:03:07PM +0200, lisa-asket@perso.be wrote:
> Have been trying to set PS1 and PS0 for my terminal using tput but getting
> some problems
>
>
>
> Â Â Â tfb_normal=$(tput sgr0)
> Â Â Â taf_red=$(tput setaf 9)
> Â Â Â taf_cyan1=$(tput setaf 51)
> Â Â Â taf_gold1=$(tput setaf 220)
> Â Â Â PS1='\n${taf_cyan1}\u@\h:\n'
> Â Â Â PS1=$PS1'+ ${taf_gold1}\w\n${taf_red}'
>
> Â Â Â PS0='${tfb_normal}'$PS0Â # use regular foreground color
You're forgetting to put \[ \] around the terminal escape sequences
in PS1.