Re: [Bashburn-info] Fix spaces in author field + prompt issue
Brought to you by:
bashburn
|
From: Steven W. O. <st...@sy...> - 2008-08-30 14:49:37
|
On Saturday, Aug 30th 2008 at 10:23 -0000, quoth Steven W. Orr: =>On Saturday, Aug 30th 2008 at 05:46 -0000, quoth Nick Warne: => =>=> =>=>func/configfunc.sh commited - I think this is the right thing to do. => =>Seems to work. What I had was in fact a problem. Thanks. => =>=> =>=>Also I noticed when at a menu prompt, if you type any character, then =>=>use the left arrow key, the cursor jumps to the first position BEHIND =>=>the prompt. =>=> =>=>It doesn't affect the data (you can still edit it). =>=> =>=>I don't know how to fix this. => =>Now I see the problem. The actual prompt for the read is not coming from =>the read. It came from the echo previous. I have a solution. Wait for it. =>:-) Ok. Here's the problem. read doesn't process control characters in the prompt. We could embed actual binary chars in the prompts. Very bad idea. The better way to go is to do this: red="\e[1;31m" off="\e[1;0m" prompt=$(printf "%bHello%b there" $red $off) read -e -p "$prompt" vv This will solve the problem because then the prompt will start on a particular column number and it will be because read put it there. -- Time flies like the wind. Fruit flies like a banana. Stranger things have .0. happened but none stranger than this. Does your driver's license say Organ ..0 Donor?Black holes are where God divided by zero. Listen to me! We are all- 000 individuals! What if this weren't a hypothetical question? steveo at syslang.net |