[Top][All Lists]

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

Re: is it a bug that \e's dont get escaped in declare -p output

From: Greg Wooledge
Subject: Re: is it a bug that \e's dont get escaped in declare -p output
Date: Wed, 17 Mar 2021 14:22:59 -0400

On Wed, Mar 17, 2021 at 01:55:56PM -0400, Eli Schwartz wrote:
> On 3/17/21 12:43 PM, Alex fxmbsw7 Ratchev wrote:
> > it makes the output no more possible if interpreted by tty
> > the \e's get processed by terminal and no more .. just an example where it
> > is so:
> > 
> > var=$'1\e[G\e[K2' ; declare -p var
> > 
> > if G was H for other line then it completly messes the terminal up
> > 
> > isnt it better to escape by \e ? ..
> Why is it the bash script interpreter's job to escape user-supplied
> strings based on how a terminal emulator chooses to *visually* display
> the results?

Call it a request for enhancement.

I thought, for a moment, that bash already used $'...' quoting for
newlines, but it turns out that's false.  At least for declare -p.
It would be nice if it did, though.  Newlines, carriage returns, escape
characters, etc.

reply via email to

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