[BusyBox] Re: New comm applet

Rob Sullivan cogito.ergo.cogito at gmail.com
Sun Apr 3 09:02:47 UTC 2005


Nevertheless, the point still remains - less would be much smaller if
it uses ANSI sequences alone, and that's how I intend to program it.
Busybox doesn't have the option of using curses without growing
significantly, and implementing it would subvert the project's goals.
After all, less is only a pager - yes, it might have some regular
expression searching and other advanced features, but when it comes
down to it it's simply designed to look through text in a
user-friendly way. Emacs, however, is quite different. Its goals do
not include small size and fast speed, and given that it does not have
the constraints Busybox has imposed upon it, it can use pretty much
whatever programming libraries it chooses. Its explicit rebuttal of
ANSI escape sequences is most likely due to an attempt on the part of
its programmers to create a cleaner development environment, as it's
quite clear that simply calling curses functions is much easier than
specifing ^[[A for the up arrow key, although that is itself what
curses does. This sentiment is seen throughout GNU programs, and quite
rightly; it means that programs end up far more maintainable and clear
as a result. The tiny less implementation I'm programming will, as a
result of using the sequences themselves, be much less cleaner to
program and to debug, and I'm quite sure that I'm reinventing the
wheel on several occasions when I could just use curses. But when size
and speed are a prerogative, that kind of programming is necessary.

On the development side of things, I've already written a getch()
routine that grabs a character or an arrow key alternatively using raw
terminal input, but this requires the use of "stty raw -echo
</dev/tty" and "stty cooked echo </dev/tty". Are there any other
cleaner ways of doing it (back to my point above, of course)?



More information about the busybox mailing list