KaoShell is not an OS but it is as close as I will ever come to creating one. I prefer command line interfaces so I left the original shell in place, I just overrode the normal shell and re-inserted it with some major updates which are as follows:
Layer modification:
the term API has been largely changed so you can recall any text that is on the screen at any time with the term.getTextAt(x,y,len) function, it also implements a layering system so you can have a separate layers for different programs/functions, you can create a new layer with the term.newLayer([reference,tParams]) command which will then return a layer at y-index: reference (a higer numerical reference means it is rendered on top of lower references), you can term.redirect to layers and restore again and treat them as individual terms. tParams is a table of arguments that will be covered in the upcoming video tutorial (it will also include a lot more details on usage of the layer API and how it changes things)
A scroll bar has been added to the right of the screen showing how far the term layer has been scrolled and you can scroll layers by a negative number to scroll back upwards. A monitoring daemon has also been added for advanced computers so that if you scroll upwards or downwards or click the arrows on the scroll bar the screen scrolls in the appropriate direction, it also moves the cursor up when you scroll down etc so you do not lose your place
Messaging daemon:
Running in parallel with the shell is a coroutine to display messages, it uses the layer modification to display messages on layer 100, call os.queueEvent("message","This is a test message",5) to display "This is a test message" at the top of the screen for 5 seconds, the timout is optional and defaults to 2
Coroutine management:
On KaoShell execution the normal CC shell is re-executed but this time you can add additional coroutines which run in parallel with the top level shell (and the other KaoShell elements), simply call KaoShell.addCo(function,[reference,display]) to add a function that will be run in parallel with the shell, it will be stored in a table of coroutines that are organised by their reference numbers.
The addCo function returns the reference number of your thread once it is created, you can also specify a custom reference as the second argument in the function.
As your coroutines run you will be notified via the messaging daemon if there are any errors or if the coroutine terminates. If the third argument is true then you will not be notified when the coroutine terminates so you can make coroutines designed to run for a short while and then terminate.
Call KaoShell.remCo(reference,display) to instantly terminate a coroutine, if display is true it will show the normal temination message at the top of the screen.
Call KaoShell.getCo(reference) to get a coroutine table back in case you need to edit it
Rather than queuing events that get in the way of all of the other coroutines you can use KaoShell.queueEvent(reference, events) to queue events for a specific routine. I am thinking of adding an event filter where you can manage what kind of events are sent to certain coroutines but am not sure what security issues this would cause
myNet networking daemon:
The myNet addon is a rednet monitor that allows myNet computers to forward messages around, call myNet.send(message,[id]) to send a message to the specified computer ID running myNet or broadcast to all myNet computers in range, they will in turn forward the message on etc. call myNet.receive([timeout]) to receive myNet messages
Peripheral monitoring:
KaoShell computers are always watching for peripheral events, if a peripheral is attached or detached from the machine it displays a message at the top of the screen, notifying you. Any modems attached to the computer are automatically opened
Automated position tracking:
If a modem is attached to the computer when it starts up it will attempt to locate its position and store it in a hidden file where it will be read in future, if it is a turtle it will then try to move back, re-locate and move forward again. It will then use that information to calculate its facing.
You can also use KaoShell.setPos(x,y,z,face) to set it and KaoShell.getPos() to retrieve it.
Once the computer knows its position it acts as a GPS host in addition to its other activities, turtles track their position as they move and act as mobile GPS hosts (compatible with old and new GPS functionality)
Basic GUI API:
KaoShell includes a very basic GUI API that takes advantage of the layer addon and coroutine functions so you can add buttons to your screen with a single command, it is still in development.
FS override:
KaoShell overrides the default fs API to hide its core functions and files so they do not get in your way, you can create files with the same filenames as KaoShell files and it will redirect you to other files, use fs.old.list etc. to access these files if the need arises
Auto Update:
As new versions of KaoShell are released you will be automatically updated if your http API is enabled, if you want to opt out and keep the current version change the version number at the top of the file to 100, set it to 0 to force update. After an update the old KaoShell is backed up in KaoShell.bak in case you need to restore it
Variable Tab Completion:
I have modified the read function to auto-complete global variables when you press tab so
"str"+tab="string"
and "str.du"+tab="string.dump"
etc. Keep pressing tab to cycle through the possible solutions, it separates these completions with spaces so "randomstring str"+tab="randomstring string"
and if you press left arrow key to move the cursor back until it is on a different word it will tab complete that word. I also made it so read does not cling to its starting cursorPos, if you term.setCursorPos somewhere else it will move to that position.Pastebin: http://pastebin.com/Yr3NQqQg
A video tutorial will be made soon with examples on how to use all of the above functions. If you have any functionality requests please ask, I especially need requests for the GUI API