mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 18:55:03 -04:00
Merge remote-tracking branch 'upstream/master-MC1.9.4' into master-MC1.10
This commit is contained in:
commit
064d9bd55a
@ -4,14 +4,10 @@ local tty = require("tty")
|
||||
local text = require("text")
|
||||
local sh = require("sh")
|
||||
|
||||
local input = table.pack(...)
|
||||
local args = shell.parse(select(3,table.unpack(input)))
|
||||
if input[2] then
|
||||
table.insert(args, 1, input[2])
|
||||
end
|
||||
local args, options = shell.parse(...)
|
||||
|
||||
shell.prime()
|
||||
local update_gpu = io.output().tty
|
||||
local update_gpu = io.output().tty and not options.c
|
||||
local needs_profile = io.input().tty
|
||||
local input_handler = {hint = sh.hintHandler}
|
||||
|
||||
@ -38,7 +34,7 @@ if #args == 0 then
|
||||
io.stderr:write((reason and tostring(reason) or "unknown error") .. "\n")
|
||||
end
|
||||
end
|
||||
elseif not interactive then
|
||||
else
|
||||
return -- eof
|
||||
end
|
||||
if update_gpu and tty.getCursor() > 1 then
|
||||
|
@ -24,9 +24,6 @@ local source_data = process.list[source_proc].data
|
||||
source_data.aliases = current_data.aliases -- hacks to propogate sub shell env changes
|
||||
source_data.vars = current_data.vars
|
||||
source_data.io[0] = file -- set stdin to the file
|
||||
if options.q then
|
||||
source_data.io[1] = {tty=false,write=function()end} -- set stdin to the file
|
||||
end
|
||||
process.internal.continue(source_proc)
|
||||
process.internal.continue(source_proc, "-c")
|
||||
|
||||
file:close() -- should have closed when the process closed, but just to be sure
|
||||
|
@ -40,5 +40,5 @@ shell.setWorkingDirectory(os.getenv("HOME"))
|
||||
|
||||
local home_shrc = shell.resolve(".shrc")
|
||||
if fs.exists(home_shrc) then
|
||||
loadfile(shell.resolve("source", "lua"))(home_shrc, "-q")
|
||||
loadfile(shell.resolve("source", "lua"))(home_shrc)
|
||||
end
|
||||
|
@ -261,12 +261,12 @@ function tty.internal.build_vertical_reader()
|
||||
}
|
||||
end
|
||||
|
||||
-- read n bytes, n is unused
|
||||
function tty.read(self, handler, cursor)
|
||||
-- PLEASE do not use this method directly, use io.read or tty.read
|
||||
function tty.read(_, handler, cursor)
|
||||
checkArg(1, handler, "table", "number")
|
||||
checkArg(2, cursor, "table", "nil")
|
||||
|
||||
if not io.stdin.tty or io.stdin.stream ~= self then
|
||||
if not io.stdin.tty then
|
||||
return io.stdin:readLine(false)
|
||||
end
|
||||
|
||||
@ -320,8 +320,9 @@ function tty.setCursor(x, y)
|
||||
window.x, window.y = x, y
|
||||
end
|
||||
|
||||
function tty.write(self, value)
|
||||
if not io.stdout.tty or io.stdout.stream ~= self then
|
||||
-- PLEASE do not use this method directly, use io.write or term.write
|
||||
function tty.write(_, value)
|
||||
if not io.stdout.tty then
|
||||
return io.write(value)
|
||||
end
|
||||
local gpu = tty.gpu()
|
||||
|
Loading…
x
Reference in New Issue
Block a user