diff --git a/src/main/resources/assets/opencomputers/loot/openos/bin/sh.lua b/src/main/resources/assets/opencomputers/loot/openos/bin/sh.lua index 8a724be71..a095d0de3 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/bin/sh.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/bin/sh.lua @@ -5,6 +5,8 @@ local sh = require("sh") local args = shell.parse(...) +local t = type + shell.prime() if #args == 0 then @@ -19,6 +21,7 @@ if #args == 0 then if tty.getCursor() > 1 then io.write("\n") end + io.write("type:", t(type), '\n') io.write(sh.expand(os.getenv("PS1") or "$ ")) end tty.window.cursor = input_handler @@ -31,8 +34,8 @@ if #args == 0 then elseif command ~= "" then --luacheck: globals _ENV local result, reason = sh.execute(_ENV, command) - if not result then - io.stderr:write((reason and tostring(reason) or "unknown error") .. "\n") + if not result and reason then + io.stderr:write(tostring(reason), "\n") end end elseif command == nil then -- false only means the input was interrupted diff --git a/src/main/resources/assets/opencomputers/loot/openos/lib/sh.lua b/src/main/resources/assets/opencomputers/loot/openos/lib/sh.lua index f483aee22..877e9b4a3 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/lib/sh.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/lib/sh.lua @@ -198,7 +198,7 @@ function sh.execute(env, command, ...) if type(words) ~= "table" then return words, reason elseif #words == 0 then - return true, 0 + return true end -- MUST be table.pack for non contiguous ...