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

Extended Shell - Advanced Tab-completion and Suggestions, Command History, Lua, Find, Cat. v3.0 - Rewritten.

Started by Wojbie, 06 November 2013 - 08:02 PM
Wojbie #1
Posted 06 November 2013 - 09:02 PM
Extanded Shell project has been canceled due to addition of auto-complete to standard shell in ComputerCraf versions past 1.73. This post is for people using older versions.

There is a program called Shell Utility Extended that is basically a new child/sibling of this thing. To read more about it look here


Extended Shell - Advanced Tab-completion and Suggestions, Command History, Lua, Find, Cat. v3.0 - Rewritten.

Complete rewrite for versions 1.6 up.

Extended Shell if extension/modification of standard ComputerCraft Shell. Included are many new and useful features that make coding and working with shell much easier. Works perfect on Portable Computers as well as on all other devices :D/>.

Download Here: http://pastebin.com/wJVmXZv7
Or ingame by using command:
pastebin get wJVmXZv7 filename
(requires http-api to be active)





Features List:
  • Tab-Completion of commands. Lists default vanilla programs system commands and filesystem itself. Also lists possible arguments for vanilla programs. When you press Tab it will ether fill out whole name(if one possible) or print out list of possibles and fill out common part. If you are pointing at folder it will print out all files in said folder.
  • Ghost suggestions - If there is a common part of word or only one word to write out it will show it in gray on advanced computers and in black (visible on large monitors) on bw ones. If you have yet to write something it will tell you what it needs next if it knows.
  • Intelligent suggestions - for programs its coded for it has advanced abilities - in case of chat it lookups hostnames in area and lists them for you, in case of programs that need diskdrive/monitors it lists only sides that have them (includes wired modem systems detection of peripherals)
  • Build in lua interface - type "!lua" followed by lua command to execute it. Type "!rlua" to reset shell lua environment. For fast command testing.
  • Build in cat. Simply write "!cat" followed my paths to files (can be one can be many) and it will write contents of those files to console. If needed result gets paged. For fast file lookup
  • File search. Use "!find" to look for file on computer by name.
  • Permanent Command History - Last 100 commands that you called are stored in shell log file. Don't store empty enters for even more practical space.
  • Whole Shell is written to allow live use. If placed anywhere not in rom it will store history in hidden file next to it. That allows you to keep in of floppy and take with you everywhere.!
  • Also Written in way that allows to use it as main shell on computer. Simply replace "rom/programs/shell" with this file and you will have Extended Shell on all Computers.
Change-log:
Spoilerv3.0 - Release of rewritten version of On OS Sub-forum - First Rewrite

Plans For Future:
Spoilerscrollable terminal history
more useful system commands (looking for suggestions)

Any Comment and Suggestions how to improve Code are appreciated.

Pre 1.6 archived 2.1 versionExtended Shell -Tab-completion, Command History, Pastebin, Lua, Find, Cat, Clock. v2.1

Extended Shell if extension/modification of standard ComputerCraft Shell. Included are many new and useful features that make coding and working with shell much easier.

Download Here: http://pastebin.com/tQutzmaX
Or ingame by using command:
pastebin get tQutzmaX filename
(requires http-api to be active)




Features List:
  • Tab-Completion of commands. When you press Tab it will ether fill out whole name(if one possible) or print out list of possibles and fill out common part. If you are pointing at folder it will print out all files. You can even force it to show hidden files by specifying "."(a common start for all hidden files.). This will work in middle of command to. So per example you have
    cp rom/ disk/test
    and want to tab-complete path to programs from "rom/" you can do it.!!! But remember you need to be at end of path for it to work (so in example cursor must be after "/" in "rom/".
  • Build in lua interface - type "lua<" followed by lua command to execute it. Type "lua#" to reset shell lua environment. For fast command testing.
  • Build in cat. Simply write "cat<" followed my paths to files (can be one can be many) and it will write contents of those files to console. If needed result gets paged. For fast file lookup
  • File search. Use "find<" to look for file on computer by name or "findpattern<" to look for said file using string library patterns.
  • Permanent Command History - Last 100 commands that you called are stored in shell log file. Don't store empty enters for even more practical space.
  • Build in Pastebin cammand - Allows you to download any pastes from your account by simply logging in it using pastebin web api. commands are plogin<,plogout<,pget<,plist<. For more info on how to use it see spoiler below,
  • Super Extra Clock in active line!! Always be on time! (You can turn clock on and off using "clock<" command
  • Whole Shell is written to allow live use. If placed anywhere not in rom it will store pastes and history in hidden file next to it. That allows you to keep in of floppy and take with you everywhere.!
  • Also Written in way that allows to use it as main shell on computer. Simply replace "rom/programs/shell" with this file and you will have Extended Shell on all Computers.
More Screen-shots:
SpoilerTab-Completion (and color/non color difference)




vpastebin in works.


"cat<" and "lua<" action

Useage of paste commands
SpoilerThere are 4 simple commands that allow you to log in and download your pastes.
  • plogin< - asks for login ans password to pastebin and then authenticates to it for use of other commands
  • plogount< - logs out from pastebin
  • pget< [path] - lists all pastes in user library - allows to selcet one that is then downloaded to [path]
  • plist< - lists all pastes and allows downloading more that one at the time. pastes are downloaded into Pases folder next to shell file or in "/" if shell file is in read only directory.

Change-log:
Spoilerv1.0 - Release On OS Sub-forum - First Relase
v1.1 - Added ".vfsprograms.dat" for loading pastes into rom/programs
v1.2 - Rewrote message handling and added "cat<"
v1.2.1 -Added "clock<" command to toggle clock on and off
v1.3 - Added ability to tab-complete path in middle of command.
v1.4 - Added ability to select single files from paste-bin account when using login file
v1.5 - Small code cleanup - removed 200 lines of inactive functions.
v2.0 - Added file finding and edit modyfication
v2.1 - Removed all vitrtual files system due how shoddy i coded it, this means that list and edit are no longer modyfied. Moved all pastebin code into shell itself as build in commands.

Plans For Future:
SpoilerAdd fuel display on turtles next to clock.

Any Comment and Suggestions how to improve Code are appreciated.
Edited on 04 October 2015 - 12:45 PM
lewanator1 #2
Posted 07 November 2013 - 11:07 AM
New stuff :D/>
NeverCast #3
Posted 07 November 2013 - 02:24 PM
I love it! This needs more exposure.
Wojbie #4
Posted 07 November 2013 - 02:47 PM
New stuff :D/>
I love it! This needs more exposure.

I am happy people like it.
I just posted new update - few small tweaks and "cat<" command! Hope it will be useful for you!
TheGamerOfAction #5
Posted 12 November 2013 - 11:27 AM
An advanced shell? I've always wanted one!
Wojbie #6
Posted 25 November 2013 - 05:51 PM
UPDATE v2.0

Added command-line commands:
  • find< - prints list of files matching given name from whole file-system. All magic characters are treated as normal.
  • findpattern< - same as above but uses pattern system from lua string library for advanced search. That means magic characters matter.
  • help<,?< - lists all command-line commands that are added in ext-shell.
As for findpatter< - by using patterns outlined in string library you can do complicated file-searches.
Example:

findpatter< ^aaa
will find only files that have aaa at front of filename - not in middle or end.
Edited on 12 January 2014 - 04:14 PM
oeed #7
Posted 27 November 2013 - 05:04 AM
Tab completion! YES! This NEEDS to be added to the default shell.
Wojbie #8
Posted 12 January 2014 - 05:25 PM
UPDATE v2.1

Removed whole virtual file-system part - it was shoddy and buggy.

Moved Pastebin integration into shell itself - its available using commands plogin<,plogout<,pget<,plist<. For more info on how to use it see spoiler about it in main post.

This is technical update cause i needed to clean up code for versions 3.0 - Sorry to people that liked virtual file-system but it was not working as i wanted.

EDIT: Also small fix in cat< and how shell moves to next line after program finishes.
Edited on 12 January 2014 - 04:42 PM
Zoidberg #9
Posted 21 March 2014 - 06:01 PM
First of all: We really like your shell :P/>
I've put your shell as autostart on all our turtle (small private server with some mods ;)/> using a resourcepack. It works perfect on standard and advance computers.

Some ideas from us: (Of course the fuel display you mentioned ;)/>
It would be nice to see the id of the computer/turtle especially if no label is set. For example when you first boot the computer or after every start. (We often take a lot of turtles to our trips and don't assign labels in order to stack them and have more free inventory.)
It would be really nice if there were a possibility to configure the things displayed. Nothing fancy just some variable in a file to turn off the clock and maybe turn something other on instead. Some people don't care about the time if they are in there houses :P/>
Csstform #10
Posted 25 March 2014 - 06:11 PM
If you want a fun terminal-based game, feel free to add this - you may want yo remove the term.clear()s though.

I really like this, especially the tab-completion, I tend to shy away from GUIs, so this fits me perfectly.
Wojbie #11
Posted 25 March 2014 - 07:37 PM
I am working on new version using all newest features
Some stuff will get torn away some stuff will stay but i thing that cow-say would make a great easter egg :P/>
If you don't mind me tearing code apart and hiding it in my code. You would get all credits of-course.

Right now i am working on implementing tab-completition that takes into account new *-wildcard system in its calculation
also working on adding scroll ability to shell using custom window handler - it would allow you to scroll up to stuff that happened before (assuming that it was not cleared) that would make it more like terminal window in graphical linux distros.
Have a lot of quirks and functionalities to work out with this stuff and i am kinda weary of coding too many lines considering that latest version is still indev and stuff can change at any moment.
Turtle fuel gauge (in % or number) is in plans. Also real-time clock using Greenwitch time servers(if http enabled - you can tell it what timezone you want it to have. Can you imagine shell.realtime()?).
Also got some nice ideas that could be implemented into Multishell (like scrolling of tablist it when there is more tabs then screen-size)

You can expect extended-shell and extended-Multishell coming some time after newest vearsion of CC hits.

On personal notes i am amazed that this topic got dig up after that time of inactivity.
:D/>
Csstform #12
Posted 25 March 2014 - 10:09 PM
Sure, rip it apart! If you want to wait a day or two, I'll have an update that includes a few more features.
Wojbie #13
Posted 21 April 2014 - 09:25 PM
Rewrite! v3.0

Look up there!

Whole shell got rewritten, upgraded and rethink - Tab-competition is more advanced and intelligent, code looks better :D/> . It is 120% of its original Awesomeness!

Some parts of older versions got dropped. They may come back in future or not.

Hope you test it them!

Also special tx to Graypup for bug-testing!! Love you!
vifino #14
Posted 24 April 2014 - 08:42 AM
Wub Wub! Fanciness cubed!

I like it, its….. FANCY!

gg Wojbie.
Creator #15
Posted 24 February 2015 - 04:11 PM
Cool. If ever I write an OS, I will include it. With your permission of course!
minebuild02 #16
Posted 16 March 2015 - 01:04 PM
Can I use this in my OS?
Wojbie #17
Posted 16 March 2015 - 02:07 PM
Well its here for people to use it. Don't know what exactly you mean by use in your os but as long as credit is given feel free to use it.

If i get some free time in future i plan to rewrite/update it but don't wait for it. My timetable is in half-year intervals.
Uncertified Robot #18
Posted 17 March 2015 - 06:55 PM
Damn this is awesome!
Thanks for this!