syscall.TTY_clear()syscall.TTY_setTextColor(1)syscall.TTY_setCursorPos(1,1)syscall.TTY_print("HyperionOS Bash Shell")local a=""local b=false;local c=syscall.IO_getBoundQueue()local d=syscall.getpid()local e=0;local f=require("sys.fs")local g=false;printInline("> ")while true do local h={syscall.IO_pullEvent()}if h[1]then if not b then if h[1]=="keyTyped"then if h[3]=="\b"then if#a>0 then a=a:sub(1,#a-1)printInline("\b")end elseif h[3]=="\n"then print("")b=true;if a==""then printInline("> ")b=false else local i=nil;if f.exists("/bin/"..a)then i="/bin/"..a elseif f.exists("/bin/"..a..".lua")then i="/bin/"..a..".lua"end;if not i then print("Program not found")printInline("> ")b=false else local j=f.readAllText(i)local k,l=load(j,i)if not k then print(l)printInline("> ")end;syscall.IO_bind("bash:"..tostring(d))e=syscall.spawn(k,i)syscall.IO_bind(c)end;a=""end else a=a..h[3]printInline(h[3])end end end;g=false else g=true end;if b then local m,n=syscall.collect(e)if m then print("\nTask exited with code:\n"..tostring(n))printInline("> ")b=false else if h[1]then if h[1]=="keyTyped"and h[3]=="^c"then syscall.kill(e)print("Terminated")printInline("> ")b=false elseif h[1]=="keyTyped"and h[3]=="^d"then syscall.kill(e)syscall.exit(0)else syscall.IO_pushEvent("bash:"..tostring(d),table.unpack(h))end end end end;if g then sleep(.05)end end