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

2021-03-17 Thread Alex fxmbsw7 Ratchev
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 ? ..

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

2021-03-17 Thread Eli Schwartz
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 ter

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

2021-03-17 Thread Greg Wooledge
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' ; decl

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

2021-03-17 Thread Ilkka Virta
On Wed, Mar 17, 2021 at 8:26 PM Greg Wooledge wrote: > 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. > It does in

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

2021-03-17 Thread Greg Wooledge
On Wed, Mar 17, 2021 at 09:58:24PM +0200, Ilkka Virta wrote: > On Wed, Mar 17, 2021 at 8:26 PM Greg Wooledge wrote: > > > 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, thoug

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

2021-03-17 Thread Alex fxmbsw7 Ratchev
hm at least now we know array declare -p formatting would work in workarounds, good to .. :) On Wed, Mar 17, 2021 at 9:05 PM Greg Wooledge wrote: > On Wed, Mar 17, 2021 at 09:58:24PM +0200, Ilkka Virta wrote: > > On Wed, Mar 17, 2021 at 8:26 PM Greg Wooledge wrote: > > > > > I thought, for a mo

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

2021-03-17 Thread Léa Gris
Le 17/03/2021 à 20:58, Ilkka Virta écrivait : On Wed, Mar 17, 2021 at 8:26 PM Greg Wooledge wrote: 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 retur

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

2021-03-17 Thread Léa Gris
Le 17/03/2021 à 21:13, Alex fxmbsw7 Ratchev écrivait : hm at least now we know array declare -p formatting would work in workarounds, good to .. :) Instead of: var=$'1\e[G\e[K2' ; declare -p var do: var=$'1\e[G\e[K2' ; printf 'declare -- %s\n' "${var@A}" And if you want a human readable dum

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

2021-03-17 Thread Chet Ramey
On 3/17/21 4:04 PM, Greg Wooledge wrote: On Wed, Mar 17, 2021 at 09:58:24PM +0200, Ilkka Virta wrote: On Wed, Mar 17, 2021 at 8:26 PM Greg Wooledge wrote: 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 w