This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Sewbacca's profile picture

Just Scrolling Shell - one extension to the default shell

Started by Sewbacca, 28 December 2017 - 10:30 PM
Sewbacca #1
Posted 28 December 2017 - 11:30 PM
Just Scrolling Shell

Description:
Just Scrolling Shell is a shell which can everything what do normal shell does (copy and paste yeah ;P) and one feature more: Scrolling
Well it isn't as good as the lovely Mildly Better Shell (try it!), but an alternative. The shell buffers 250 lines.

Why shouldn't I use just Mildly Better Shell?
Well first of all, it creates files on your system and then you have to install the beta version. My shell works definatly on CC 1.7 and probably till 1.79.

Usage:
Mouse middle click returns to cursor position.
Mouse scrolls one line per tick.
Page up or down scrolls the whole screen per pressed key.

Installation:
pastebin get 6qpzWuLb ScrollingShell
Run it per
>ScrollingShell

Documentation for the shell API:
SpoilerNormal shell API.
Plus:
shell.allowScroll()
Allows scrolling in your program.
shell.disallowScroll()
Disallows scrolling in your porgram (default).

License: MIT
Edited on 30 December 2017 - 07:07 PM
SquidDev #2
Posted 29 December 2017 - 02:40 PM
Just tried it out: it's jolly neat. There's a couple of thoughts on things:
  • It might be nice if user input scrolled to the bottom of the screen: namely key and paste events (excluding pageUp/pageDown obviously).
  • As your code is derived from an earlier shell, running it on 1.80pr1 will throw "No such program" errors as it looks for rom/programs/xyz rather than rom/programs/xyz.lua. Replacing the relevant sections with this code should be sufficient.
  • Overriding term.native is evil: please don't do that :)/>.
Sewbacca #3
Posted 30 December 2017 - 01:45 PM
Thanks for trying out =)
I've just modified some things, for reinstall, delete ScrollingShell and redownload it with the same pastebin link.

  • It might be nice if user input scrolled to the bottom of the screen: namely key and paste events (excluding pageUp/pageDown obviously).

Yeah, I added this for paste and char events.

  • As your code is derived from an earlier shell, running it on 1.80pr1 will throw "No such program" errors as it looks for rom/programs/xyz rather than rom/programs/xyz.lua. Replacing the relevant sections with this code should be sufficient.

Yeah, I replaced the code. I had wondred why I had to write list.lua for list the directory. Will my shell work on older versions anymore?

  • Overriding term.native is evil: please don't do that :)/>.

Oh, that was a try for bugfixing and then I've forgotten that I placed that there… Thanks! =)
Edited on 30 December 2017 - 07:06 PM
SquidDev #4
Posted 30 December 2017 - 05:58 PM
Yeah, I replaced the code. I had wondred why I had to write list.lua for list the directory. Will my shell work on older versions anymore?
It should be entirely backwards compatible so everything should just work fine on either version.