Replace CraftOS pager with a better one
dmarcuse opened this issue · 6 comments
textutils.pagedPrint
and textutils.pagedTabulate
are pretty bad, replacing them with a custom pager that can be scrolled properly (basically less
) would be nice.
I'm not entirely sure how this will function with help
. This prints each line in the file with a separate call to textutils.pagedPrint
, which makes it much harder to have one unified pager.
For reference the following programs use these methods:
pagedTabulate
:alias.lua
,apis.lua
,command/commands.lua
,help.lua
,list.lua
,programs.lua
pagedPrint
:help
,set
Of these, help
is the only one with funky handling.
In that case, why not just write a custom help
program and set the path so that it's resolved first?
Yeah, I probably will. Might also PR that change into CC - there's a couple of other minor tweaks I'd like to make to the Lua side of things.
The other thing worth bearing in mind is whether the pager behaves like less
or less -F
, and if there's any situations we might want to disable it entirely. For instance, I'm not sure if list
(ls
/dir
) should use a pager or just print everything to the terminal and allow people to scroll.
I guess I could provide some setting which allows people to control that (as well as program-specific control or something), but it seems a little cumbersome.
You could also replace the list
program if necessary 😛
@Lupus590 Yep. Currently neither change really touches textutils.pagedTabulate
, which is the other big function - I suspect that'll need to wait until I've reviewed cc-tweaked/CC-Tweaked#522.
Speaking of which, I haven't forgotten your PR, just laptop is currently dead, so there's a limit of how much work I can do.