[BusyBox] New version cmdedit

Erik Andersen andersen at lineo.com
Sun Feb 18 21:28:50 UTC 2001


On Sun Feb 18, 2001 at 04:08:34PM +0300, Vladimir N. Oleynik wrote:
> 
> Also all erroneous.
> Please remove all revision 1.37 and 1.38.
> Require only comment #define TEST. 
> ONLY!

I do not believe my code is erroneous.

> 1) in cmdedit_init() not called redraw()

Set a breakpoint in cmdedit_setwidth() using your code
from 1.36 and watch.  cmdedit_setwidth() gets called the 
first time with cmdedit_prmt_len=0, so the width of the
terminal ignores the length of the prompt the first time.
This brokes line wrapping when the prompt is wider then 
the terminal, which I'm sure is why you added the error
message.

I have a friend who works on an IPAQ.  He runs X on his
IPAQ, but it can only display a very narrow xterm.  Try
running your code on an Xterm that is only, say 20 chars
wide.  It will error saying "minimum screen width is 31".
Well, that is unacceptably narrow, since now anyone using
the lash shell on a PDA is broken.  

> 2) cmdedit_init() required call before parse_promt()

I looked and did not see any globals being used except
by put_prompt(), which only sets something.  Could you
please show me if I made a mistake and missed something?

> 3) if (w <= cmdedit_termw) cmdedit_termw = cmdedit_termw % w;
> This strange code. Im not understand this.

You do not understand the modulo operator, or you do not
understand what I am doing with it?

> If require remove error_msg, - remove also this.

I looked at the code, and saw no reason to display that error.
Instead, I set the terminal width modulo the fact that the 
prompt has wrapped around to the other side of the screen.

To test, take an xterm and make it be very narrow so that 
the prompt is wider then the terminal, then type a very long 
line.  Then hit ^A and ^E and it should wrap properly.

> PLEASE ask me before apply patchs to my code!

This is why we have CVS.  If I screw up, everyone can see
my mistakes and complain and we can fix it.

> I have quick react!

And I am glad.  But keep in mind, sometimes people disagree.
For example, over the last few days, Larry and I disagreed over 
some Makefiles changes.  He did not shout or call me authoritarian.  
He sent patches and explained why his was was better.  I listened,
since he was right about a number of things, and we came to a 
compromise I think we are both happy with.  

I would like it very much if, when you disagree with a change, you
would send in a patch that shows why your way is better.  I think
I am a very reasonable person, and I am glad to see patches with 
explanations about what I did wrong, and how it can be better.  I 
am happy to admit when I make a mistake, and fix things.

 -Erik

--
Erik B. Andersen   email:  andersen at lineo.com
--This message was written using 73% post-consumer electrons--





More information about the busybox mailing list