CC: Tweaked

CC: Tweaked

42M Downloads

User made shell launch issue (bios improvement)

MAGGen-hub opened this issue ยท 2 comments

commented

Why we always need to start working from the shell or multishell? Thats weird! It looks like... well... you can launch Windows and Linux (custom user shell) but to launch it you need to launch DOS(shell.lua / multishell.lua) first. I want this part of bios.lua to be changed. My solution is:
Insert this to bios.lua 939 line

settings.define("bios.custom_shell", {
    default = nill,
    description = "Allow user to launch his own shell or program that will run as core. Be carefull with this!",
    type = "string",
})

And change shell run like this:

-- Run the shell
local ok, err = pcall(parallel.waitForAny,
    function()
        local sShell
        local bSuccess = true
        if settings.get("bios.custom_shell")  then
			sShell = settings.get("bios.custom_shell")
        else if term.isColour() and settings.get("bios.use_multishell") then
            sShell = "rom/programs/advanced/multishell.lua"
        else
            sShell = "rom/programs/shell.lua"
        end
        bSuccess = bSuccess and os.run({}, sShell)
        bSuccess = bSuccess and os.run({}, "rom/programs/shutdown.lua") -- in fact I want to remove this too and replase with my custom shutdown with GUI "Goodbuy" (but i just use os.shutdown to disable this)
        
        -- Whops! Something went wrong (posible termination) and our custom shell errored! Better not to launch it again until player remove the problem.
        if not bSuccess then
        settings.unset("bios.use_multishell")
        end
    end,
    rednet.run
)

It also wold be cool if we can access bios settings and other with some key (like holding Del or F10) but I think it's to much for ingame computer)))

So can you impove bios in next versions of your modification or it's imposible for some reason?
If thats imposible, please tell me how I can change it (with recourse pack) without messing up your mod code (I mean I don't want to change bios.lua inside your mod I need to "override" it but don't know how)?

Thank you for your attantion. Good luck in development!
P.S. (I also want to see terminals and monitors with higer resolution (like graphic monitors in OpenComputers) and unicode support (Want to see Russian lang in PC), but I know that it extrimly hard to made that, so... I just whant to know you plan to do them or not, or how can I do this by my own?)

commented

I'm afraid I'm probably not going to implement this. I've touched on this in more detail in #710, but bypassing the bios (or shell in this case) doesn't really give you anything special - anything (useful) you can do outside the shell you can do inside! I may be wrong here - if someone can write something useful which needs to run outside the shell I'm happy to consider it - just nobody has given it a go yet.

If thats imposible, please tell me how I can change it (with recourse pack)

You can do this with a datapack which just overrides the bios. There's an example datapack here, you'll need to copy CC:T's bios.lua to data/computercraft/lua/bios.lua, make your changes above, and then copy the datapack into your world.

I also want to see terminals and monitors with higer resolution

There's some config options to change the computer resolution. Not really sure I want to do things with monitors - you can get them big enough as is, and the network traffic is bad enough already :/.

unicode support

I assume you've seen #860? We've got some API ideas, just need the time to hash it out into something we're comfortable with.

commented

UnBIOS may be of some interest to you. It undoes all of the changes made by the BIOS, reverts the system back to the state it was in immediately on startup, and executes a custom BIOS of your choice. It's not an officially supported feature in CC and uses some debug trickery to work, but it works very well. If you want to run a custom BIOS on startup, just save it as startup.lua and it'll automatically run the new bios.lua as if CraftOS never existed.

If you just want to run a custom shell on startup, then just use a startup file!

shell.run("cash.lua")
os.shutdown()