Re: Read Prompt Width Miscalculation (Non-Printing Characters)

2022-12-29 Thread Chet Ramey
On 12/29/22 5:37 AM, The Administrator wrote: ... or you can write your prompt string as you would write PS1 and use the ${word@P} expansion when you pass it as an argument to `read' (preferred). This is new to me.  Thank you. Should I write a patch for the man page? The parameter

Re: Read Prompt Width Miscalculation (Non-Printing Characters)

2022-12-29 Thread The Administrator
... or you can write your prompt string as you would write PS1 and use the ${word@P} expansion when you pass it as an argument to `read' (preferred). This is new to me. Thank you. Should I write a patch for the man page?

Re: Read Prompt Width Miscalculation (Non-Printing Characters)

2022-12-28 Thread Chet Ramey
On 12/28/22 2:09 PM, The Administrator wrote: Hello and happy holiday hacking.  Does the read builtin stand to benefit from \[ and \] denotation ala $PS1 and friends?  Here is a quick example: read -erp "$( tput setaf 2 )NEW:$( tput sgr0 ) " You can either use $'\001' and $'\002' in place

Re: Read Prompt Width Miscalculation (Non-Printing Characters)

2022-12-28 Thread The Administrator
There's a (secret?) feature of readline that lets you do \[ \] type stuff using 001 and 002 bytes instead. This made my day! Thank you.

Re: Read Prompt Width Miscalculation (Non-Printing Characters)

2022-12-28 Thread Greg Wooledge
On Wed, Dec 28, 2022 at 01:09:02PM -0600, The Administrator wrote: > Hello and happy holiday hacking. Does the read builtin stand to benefit > from \[ and \] denotation ala $PS1 and friends? Here is a quick example: > > > read -erp "$( tput setaf 2 )NEW:$( tput sgr0 ) " > > Fill the line with