Make Shell scrollable
JakobDev opened this issue ยท 6 comments
It would be good, if you can scroll in the shell on a advanced Computer with the Mousewhell.
That sounds like something easily programmable with moderate difficulty by user. In fact i believe there are some implementations of this already on computer craft forums. I do believe this does make a nice project for end user to make.
So I implemented this for ClamShell:
The implementation isn't too hard: you can just have a "growable" framebuffer, which adds additional lines when term.scroll
is used. However, there are a couple of things you've got to think about:
-
What to do about programs which clear or overwrite existing lines. For instance,
edit
leaves a lot of additional whitespace, andpaint
will delete previous history. One solution would be something like ncurses' private mode, where the program instructs the shell to draw the current program into a separate buffer, preserving the existing history. ClamShell tries to guess this "private mode", entering it if you callterm.clear
, but an explicitmultishell.noScroll()
or something would be better. -
When do you allow people to scroll up/down? Obviously you don't want to do that all the time as that breaks programs like
edit
. But again, you should be able to do it within some programs - the Lua REPL would really benefit from scrollback. Clam Shell just overridesread
to add scrolling support, but that is a rather ugly solution and doesn't work for some GUI applications which still useread
for text input.
I think, that term.clear should clean the history. That would solve the problems.
That wouldn't solve problems, that would just cover them up. What happens with term.clearLine
or term.setCursorPos
?
I think this was about normal shell not multi shell.
And about adding contents scroll.