Re: ${var@P} expansion includes 0x01 and 0x02

2015-11-10 Thread Chet Ramey
On 11/9/15 7:53 PM, Dennis Williamson wrote: > > With editing off, I find that I must delimit variables with braces. Without > the braces, only the second escape sequence is output. The \] isn't > terminating the variable name when editing is off. When line editing isn't enabled, the \[ and \] e

Re: ${var@P} expansion includes 0x01 and 0x02

2015-11-09 Thread Dennis Williamson
On Fri, Nov 6, 2015 at 7:51 AM, Chet Ramey wrote: > On 11/5/15 7:45 PM, Dennis Williamson wrote: > > > That's what the \[ and \] escape sequences expand to and use to > > communicate information to readline about invisible characters in the > > prompt (RL_PROMPT_START_IGNORE and RL_PR

Re: ${var@P} expansion includes 0x01 and 0x02

2015-11-06 Thread Chet Ramey
On 11/5/15 7:45 PM, Dennis Williamson wrote: > That's what the \[ and \] escape sequences expand to and use to > communicate information to readline about invisible characters in the > prompt (RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE). If you want to > use the expansion of

Re: ${var@P} expansion includes 0x01 and 0x02

2015-11-06 Thread Greg Wooledge
On Thu, Nov 05, 2015 at 06:45:45PM -0600, Dennis Williamson wrote: > red=$(tput setaf 1) > none=$(tput sgr0) > greet='\[$red\]Hello\[$none\]' > printf '%s\n' "${greet@P}" > echo -e "${greet@P}" > read -e -p "${greet@P}" > > Naively stripping the delimiters in this case would leave $redHELLO$none >

Re: ${var@P} expansion includes 0x01 and 0x02

2015-11-05 Thread Dennis Williamson
On Wed, Oct 28, 2015 at 8:55 AM, Chet Ramey wrote: > On 10/27/15 5:02 PM, Greg Wooledge wrote: > > I decided to play around with the ${var@P} expansion in 4.4-beta. > > > > imadev:~$ red=$(tput setaf 1) reset=$(tput sgr0) > x='\[$red\]\u\[$reset\]@\h:\w\$ '; printf %s "${x@P}" | od -t x1 > >

Re: ${var@P} expansion includes 0x01 and 0x02

2015-10-28 Thread Chet Ramey
On 10/27/15 5:02 PM, Greg Wooledge wrote: > I decided to play around with the ${var@P} expansion in 4.4-beta. > > imadev:~$ red=$(tput setaf 1) reset=$(tput sgr0) > x='\[$red\]\u\[$reset\]@\h:\w\$ '; printf %s "${x@P}" | od -t x1 > 0001 1b 5b 33 31 6d 2 77 6f 6f 6c 65 64 67

${var@P} expansion includes 0x01 and 0x02

2015-10-27 Thread Greg Wooledge
I decided to play around with the ${var@P} expansion in 4.4-beta. imadev:~$ red=$(tput setaf 1) reset=$(tput sgr0) x='\[$red\]\u\[$reset\]@\h:\w\$ '; printf %s "${x@P}" | od -t x1 0001 1b 5b 33 31 6d 2 77 6f 6f 6c 65 64 67 1 1b 020 5b 6d f 2 40 69 6d 61 64