did mutiple changes

This commit is contained in:
2026-01-30 11:16:20 -05:00
parent 1c3d2c8b48
commit d9caf655fb
9 changed files with 318 additions and 289 deletions
+13 -6
View File
@@ -6,9 +6,10 @@ syscall.TTY_print("HyperionOS Bash Shell")
local str=""
local stopInput=false
local inputIO=syscall.IO_getBoundQueue()
local pid=syscall.HPV_getPid()
local pid=syscall.getpid()
local proc=0
local fs=require("sys.fs")
local timeout=1
printInline("> ")
while true do
local event = {syscall.IO_pullEvent()}
@@ -45,7 +46,7 @@ while true do
printInline("> ")
end
syscall.IO_bind("bash:"..tostring(pid))
proc = syscall.HPV_spawn(program, path)
proc = syscall.spawn(program, path)
syscall.IO_bind(inputIO)
end
str=""
@@ -58,7 +59,7 @@ while true do
end
end
if stopInput then
local exited, code = syscall.HPV_collect(proc)
local exited, code = syscall.collect(proc)
if exited then
print("\nTask exited with code:\n"..tostring(code))
printInline("> ")
@@ -66,16 +67,22 @@ while true do
else
if event[1] then
if event[1]=="keyTyped" and event[3]=="^c" then
syscall.HPV_kill(proc)
syscall.kill(proc)
print("Terminated")
printInline("> ")
stopInput=false
elseif event[1]=="keyTyped" and event[3]=="^d" then
syscall.HPV_kill(proc)
syscall.HPV_exit(0)
syscall.kill(proc)
syscall.exit(0)
else
syscall.IO_pushEvent("bash:"..tostring(pid), table.unpack(event))
end
timeout=10
else
timeout=timeout-1
end
if timeout<0 then
sleep(.05)
end
end
end
+7 -7
View File
@@ -1,12 +1,12 @@
local userhost = (syscall.OS_getUser() or "Unknown").."@"..(syscall.OS_getHostname() or "Unknown")
local userhost = (syscall.getUser() or "Unknown").."@"..(syscall.getHostname() or "Unknown")
print(".. *. .. | "..userhost)
print(" *= +@* +* | "../rep("-",#userhost))
print(" .@#. -@@@= :#@. | OS: "..(syscall.OS_version() or "Unknown"))
print(" =@@+ *@@@# +@@= | Host: "..(syscall.OS_getHost() or "Unknown"))
print(" %@@%: *@@@# -%@@% | Uptime: "..(syscall.OS_getUptime() or "Unknown"))
print(" :@@@@+ *@@@# .*@@@@: | Tasks: "..tostring((#syscall.HPV_list() or "Unknown")))
print(" *= +@* +* | "..string.rep("-",#userhost))
print(" .@#. -@@@= :#@. | OS: "..(syscall.version() or "Unknown"))
print(" =@@+ *@@@# +@@= | Host: "..(syscall.getHost() or "Unknown"))
print(" %@@%: *@@@# -%@@% | Uptime: "..(syscall.getUptime() or "Unknown"))
print(" :@@@@+ *@@@# .*@@@@: | Tasks: "..tostring((#syscall.getTasks() or "Unknown")))
print(" :*@@@%- *@@@# -@@@@*: | Packages: ".."Unknown")
print(" =%@@#. *@@@# .#@@%= | Shell: "..(syscall.HPV_getEnviron("SHELL") or "Unknown"))
print(" =%@@#. *@@@# .#@@%= | Shell: "..(syscall.getEnviron("SHELL") or "Unknown"))
print(" :=. :*@@= *@@@# =@@+: .=: | ")
print(" %@#=..*# +@@@# #*..=#@# | ")
print(" .@@@@+=# .%@%: #=+@@@@. | ")
+1 -1
View File
@@ -1,4 +1,4 @@
local fs = require("sys.fs")
local bashStr = fs.readAllText("/bin/bash")
local bashFun = load(bashStr)
syscall.HPV_spawn(bashFun, "bash")
syscall.spawn(bashFun, "bash")