help-bash
[Top][All Lists]
Advanced

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

Re: realine messup with dynamic PS1


From: Christoph Anton Mitterer
Subject: Re: realine messup with dynamic PS1
Date: Fri, 07 Aug 2026 04:22:58 +0200
User-agent: Evolution 3.56.2-10+b1

Hey again

On Thu, 2026-08-06 at 11:22 -0400, Chet Ramey wrote:
> This time, the LLM is correct. There are two stages of prompt
> expansion:
> first the expansion of backslash escapes, then word expansions.

I had just one new case of that "prompt corruption", but AFAICS all my
escape sequences produced from expansions are properly surrounded by
\001 and \002.

\[\e[0m\]\[\e[32m\]\u\[\e[0m\]\[\e[2;37m\]@\[\e[0m\]\[\e[32m\]\h\[\e[0m\]\[\e[2;37m\]:\[\e[0m\]\[\e[1;34m\]\w\[\e[0m\]$(
 [ "$?" -eq 0 ] && { [ -n "$(jobs -s; jobs -r)" ] && printf '%s{%s%s\j%s%s}%s' 
'\001\e[2;37m\002' '\001\e[0m\002' '\001\e[36m\002' '\001\e[0m\002' 
'\001\e[2;37m\002' '\001\e[0m\002'; true; } || { [ -n "$(jobs -s; jobs -r)" ] 
&& printf '%s{%s%s\j%s%s}%s' '\001\e[2;37m\002' '\001\e[0m\002' 
'\001\e[36m\002' '\001\e[0m\002' '\001\e[2;37m\002' '\001\e[0m\002'; false; } 
)$( [ "$?" -eq 0 ] && printf '%s' '\001\e[2;37m\002' || printf '%s' 
'\001\e[31m\002' )\$\[\e[0m\]\[\e]0;\u@\h:\w\a\] 

The only thing that I could think of is that I have that \j (number of
jobs) produced from a command substitution... could that cause any
troubles?

Maybe it was just some other glitch though.


Thanks,
Chris.



reply via email to

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