Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ANSI bg colour outside of prompt area



On 02/22/2015 11:10 AM, Bart Schaefer wrote:
} In zsh, the background color gets reset once the characters have been
} printed.

That's intentional so that a misbehaving program can't e.g. cause your
prompt to become invisible by changing the background to the same color
as your prompt foreground.

That makes sense, and I suppose, as you say, the more direct thing is to manipulate the terminal, tho that means a restart anytime you wanted one of those color changes, and my xfce4-terminal doesn't seem to permit command line color changes anyway. But to the extent that zsh supports color, shouldn't the colors stay set until they are explicitly changed? I see in bash:

echo -e "\e[41m"
red
red
red
echo -e "\e[0m"
normal
normal
normal

I get exactly what I ask for--when I want to return to defaults, I say so.

So, would it be possible to have, say, an option to stop ZLE from clearing the screen as it does? I can see that the zsh way is safer, but being able to turn it off sounds like a cool option as well, and friendly to our bash converts besides.



Messages sorted by: Reverse Date, Date, Thread, Author