Patch for a better "more"

Denys Vlasenko vda.linux at googlemail.com
Wed Aug 15 20:30:06 UTC 2007


On Wednesday 15 August 2007 05:46, Tristan Schmelcher wrote:
> Hello,
>
> I recently used BusyBox extensively in an embedded device product and
> ended up making some improvements to the "more" command. Attached is a
> patch against BB 1.6.1. The changes are:
>
> - Fixed a number of deficiencies in the line wrapping.
> - Fixed a bug where the page could scroll multiple times per keypress.
> (The fix is to only scroll on spacebar, as with other "more"
> implementations. If an invalid character is pressed, we print a brief
> usage message.)
> - Made us re-read the terminal dimensions after user input, in case they
> resized the terminal while we were waiting.
> - Added an 'R' key to print the rest of the file without prompting.
> - Made us crudely support tabs in the line-wrapping code by converting
> them to 8 spaces (not great, but better than messing up the screen; make
> it a compile-time option if you don't like it).
>
> With this patch, the line-wrapping code now scrolls the screen correctly
> for any combination of normal characters, newlines, and tabs. And I
> think the change in code size is probably fairly small.
>
> Enjoy. I hope to see this in the next release. :)

Applied, thanks!
--
vda



More information about the busybox mailing list