help-bash
[Top][All Lists]
Advanced

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

Re: Changing PSI and PS0 leads to four characters at beginning of user i


From: Lawrence Velázquez
Subject: Re: Changing PSI and PS0 leads to four characters at beginning of user input
Date: Sun, 04 Jul 2021 15:29:04 -0400
User-agent: Cyrus-JMAP/3.5.0-alpha0-530-gd0c265785f-fm-20210616.002-gd0c26578

On Sun, Jul 4, 2021, at 3:11 PM, lisa-asket@perso.be wrote:
> \[ \]  to enclose the tput commands?

No, to enclose their output when you use it in prompt definitions.

    PS1='\n\[${taf_cyan1}\]\u@\h:\n'
    PS1=$PS1'+ \[${taf_gold1}\]\w\n\[${taf_red}\]'
    PS0='\[${tfb_normal}\]'$PS0

See <https://mywiki.wooledge.org/BashFAQ/053>.

> I thought those were only used when using escape sequences only.

It doesn't matter whether you get the escape sequences from tput(1)
or write them out yourself.

-- 
vq



reply via email to

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