Sujet : Re: bash prompt question
De : taviso (at) *nospam* gmail.com (Tavis Ormandy)
Groupes : comp.unix.shellDate : 07. Jul 2025, 00:58:08
Autres entêtes
Message-ID : <md0gsfFer35U2@mid.individual.net>
References : 1
User-Agent : slrn/1.0.3 (Linux)
On 2024-09-19, François Patte wrote:
Bonjour,
>
Wanting to personalize my bash prompt I wrote in my .bashrc file (with
the help of "Learning the BASH shell"):
>
export PS1='\[\e[1;35m\]\u@\h -\d- ${text} \W\[\e[m]\]\$ '
>
The \[\e[m]\] section seems wrong to me.
I think this is supposed to be an sgr reset which is \e[0m (although I
think omitting the 0 is usually okay), but then you include a literal ],
is that intentional?
The \[...\] is supposed to indicate unprintable characters, so the shell
knows where the cursor is.
Soo...if you did want the ], then I think it should be this:
\[\e[m\]]
Tavis.
-- _o) $ lynx lock.cmpxchg8b.com /\ _o) _o) $ finger taviso@sdf.org_\_V _( ) _( ) @taviso