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

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 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