SquidDev-CC / mbs

A Mildly Better Shell for ComputerCraft
MIT License
47 stars 9 forks source link

Replace CraftOS pager with a better one #16

Open dmarcuse opened 6 years ago

dmarcuse commented 6 years ago

textutils.pagedPrint and textutils.pagedTabulate are pretty bad, replacing them with a custom pager that can be scrolled properly (basically less) would be nice.

SquidDev commented 6 years ago

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:

Of these, help is the only one with funky handling.

dmarcuse commented 6 years ago

In that case, why not just write a custom help program and set the path so that it's resolved first?

SquidDev commented 6 years ago

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.

dmarcuse commented 6 years ago

You could also replace the list program if necessary :stuck_out_tongue:

Lupus590 commented 3 years ago

Related? https://github.com/SquidDev-CC/CC-Tweaked/pull/602 https://github.com/SquidDev-CC/CC-Tweaked/pull/603

SquidDev commented 3 years ago

@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 SquidDev-CC/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.