Re: corrupted input after size function (input that's not recorded by bash)

2013-06-25 Thread Chet Ramey
On 6/13/13 3:58 PM, Linda Walsh wrote: > > I have a small function in my bashrc: > > function showsize () {\ > local s=$(stty size); local o="(${s% *}x${s#* })"; s="${#o}";\ > echo -n $o; while ((s-- > 0));do echo -ne "\b"; done; \ > } > export -f showsize > trap showsize SIGWINCH > --- > Tha

Re: corrupted input after size function (input that's not recorded by bash)

2013-06-16 Thread Linda Walsh
Dave Gibson wrote: Trial and error suggests it's something to do with new-style command substitution. Try backticks: local s=`stty size` Yes... you are right. This works... while local s=$(stty size) does not. That's icky! I thought they were identical, they appea

Re: corrupted input after size function (input that's not recorded by bash)

2013-06-14 Thread Linda Walsh
Greg Wooledge wrote: This makes me continue to suspect that the problem is being triggered by something else in your setup (possibly multiple things working together). You might try to reproduce the problem in a simpler setup, to see if you can isolate what factors must be present for it to o

Re: corrupted input after size function (input that's not recorded by bash)

2013-06-14 Thread Dave Gibson
Linda Walsh wrote: > > I have a small function in my bashrc: > > function showsize () {\ > local s=$(stty size); local o="(${s% *}x${s#* })"; s="${#o}";\ > echo -n $o; while ((s-- > 0));do echo -ne "\b"; done; \ > } > export -f showsize > trap showsize SIGWINCH > --- > That has the effect of

Re: corrupted input after size function (input that's not recorded by bash)

2013-06-14 Thread Greg Wooledge
On Thu, Jun 13, 2013 at 04:42:36PM -0700, Linda Walsh wrote: > Chris F.A. Johnson wrote: > > The baskspaces (\b) are erasing your input, not the function's > > output. That's incorrect. A backspace character sent to a terminal device moves the cursor (or does whatever else the terminal choose

Re: corrupted input after size function (input that's not recorded by bash)

2013-06-13 Thread Linda Walsh
Dennis Williamson wrote: read _CRST < <(tput sgr0) instead of _CRST=$(tput sgr0) Run both of them with trace turned on and you'll find out. ;-) I used to have the 2nd one...got tired of having my tracing change colors when it got to that...

Re: corrupted input after size function (input that's not recorded by bash)

2013-06-13 Thread Dennis Williamson
On Jun 13, 2013 4:09 PM, "Linda Walsh" wrote: > > > > Greg Wooledge wrote: >> >> On Thu, Jun 13, 2013 at 12:58:02PM -0700, Linda Walsh wrote: >>> >>> So how can my showsize function be mangling the input in a way that >>> prevents proper execution, but isn't recorded by bash? >> >> >> What makes y

Re: corrupted input after size function (input that's not recorded by bash)

2013-06-13 Thread Linda Walsh
Chris F.A. Johnson wrote: On Thu, 13 Jun 2013, Linda Walsh wrote: I have a small function in my bashrc: function showsize () {\ local s=$(stty size); local o="(${s% *}x${s#* })"; s="${#o}";\ echo -n $o; while ((s-- > 0));do echo -ne "\b"; done; \ } export -f showsize trap showsize SIGWINCH

Re: corrupted input after size function (input that's not recorded by bash)

2013-06-13 Thread Chris F.A. Johnson
On Thu, 13 Jun 2013, Linda Walsh wrote: I have a small function in my bashrc: function showsize () {\ local s=$(stty size); local o="(${s% *}x${s#* })"; s="${#o}";\ echo -n $o; while ((s-- > 0));do echo -ne "\b"; done; \ } export -f showsize trap showsize SIGWINCH --- That has the effect of sh

Re: corrupted input after size function (input that's not recorded by bash)

2013-06-13 Thread Linda Walsh
Greg Wooledge wrote: On Thu, Jun 13, 2013 at 12:58:02PM -0700, Linda Walsh wrote: So how can my showsize function be mangling the input in a way that prevents proper execution, but isn't recorded by bash? What makes you believe it's this function that's causing your problem, and not somethin

Re: corrupted input after size function (input that's not recorded by bash)

2013-06-13 Thread Linda Walsh
It only happens when I alter the window size and the window size is printed out. Greg Wooledge wrote: On Thu, Jun 13, 2013 at 12:58:02PM -0700, Linda Walsh wrote: So how can my showsize function be mangling the input in a way that prevents proper execution, but isn't recorded by bash? What ma

Re: corrupted input after size function (input that's not recorded by bash)

2013-06-13 Thread Greg Wooledge
On Thu, Jun 13, 2013 at 12:58:02PM -0700, Linda Walsh wrote: > So how can my showsize function be mangling the input in a way that > prevents proper execution, but isn't recorded by bash? What makes you believe it's this function that's causing your problem, and not something else, such as a PROMP

corrupted input after size function (input that's not recorded by bash)

2013-06-13 Thread Linda Walsh
I have a small function in my bashrc: function showsize () {\ local s=$(stty size); local o="(${s% *}x${s#* })"; s="${#o}";\ echo -n $o; while ((s-- > 0));do echo -ne "\b"; done; \ } export -f showsize trap showsize SIGWINCH --- That has the effect of showing me my current window size when I