help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changing PSI and PS0 leads to four characters at beginning of user input


From: lisa-asket
Subject: Changing PSI and PS0 leads to four characters at beginning of user input
Date: Sun, 4 Jul 2021 21:11:54 +0200 (CEST)

\[ \]  to enclose the tput commands?  I thought those were only used when using

escape sequences only.



From: Greg Wooledge <greg@wooledge.org>
To: help-bash@gnu.org
Subject: Re: Changing PSI and PS0 leads to four characters at beginning of user 
input
Date: 04/07/2021 21:05:11 Europe/Paris

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]