[BusyBox] Re: cmdedit width setting
Larry Doolittle
ldoolitt at recycle.lbl.gov
Wed Jan 31 17:16:55 UTC 2001
Vladimir -
> if(ioctl(0, TIOCWINSIZ, prt)<0)
> equivalent setTermSettings error.
> Result: stdin not interactive, require read(0...), not cmdedit.
The concern is not with ioctl()<0, but with win.ws_col==0.
Consider the following program:
---cut here---
#include <sys/ioctl.h>
#include <stdio.h>
int main()
{
struct winsize win = { 0, 0, 0, 0 };
if (ioctl(0, TIOCGWINSZ, &win)<0) {
perror("ioctl");
} else {
printf("window size %d, %d, %d, %d\n",
win.ws_row, win.ws_col, win.ws_xpixel, win.ws_ypixel);
}
return 0;
}
---cut here---
Run from an Xterm, it gives the expected:
window size 24, 80, 499, 316
Run from the serial port of my StrongARM (via Kermit), it gives:
window size 0, 0, 0, 0
This is not too surprising, I could have connected from just about
any sort of device, the StrongARM has no clue what to report for
a window size. So I think it's important for BusyBox to work
around the situation (not really a bug) and give some sort of
sensible behavior.
> I quickly react on the code. If you also will make henceforth changes
> and completely to IGNORE ME, I shall be compelled to refuse support of
> the code and to DEMAND completely to exclude mine of editing.
> For example, a code cmdedit to return in revision 1.29.
I don't ignore anyone, although I only have 24 hours in my day,
and some items always manage to fall off the end of my to-do list.
Your cmdedit changes are good. No software is ever perfect, and
you should not be upset if other people manage to improve on what
you wrote.
Your submissions are either licensed for general use, or not.
By submitting them originally, you imply that they are. The
file header for cmdedit says:
* You may use this code as you wish, so long as the original author(s)
* are attributed in any redistributions of the source code.
* This code is 'as is' with no warranty.
* This code may safely be consumed by a BSD or GPL license.
Erik and I are using the code as we wish, by changing it to
work "right" (at least, as we wish) on a serial port. We have
no desire, or legal right, to remove attribution to you, one
of the authors.
The only way I have heard where code like this can be forced out
of a project, is if the submitter were not the original author,
and violated copyright law by submitting it in the first place.
I would like your help improving BusyBox. If your emotions are
too fragile to work in a group, where not every decision will go
your way, you are welcome to leave. Certainly nobody can force
you to stay.
Note that just as we have the right to keep some of your submissions
as part of BusyBox, you also have the right to take some or all of
BusyBox, modify it, and redistribute it. This is what people call
"forking" the project. If you choose to proceed on your own, it
would be helpful if you somehow re-label it, so people can quickly
tell which half of the project produced a particular website, binary,
or system.
- Larry Doolittle <LRDoolittle at lbl.gov>
More information about the busybox
mailing list