Merge remote-tracking branch 'upstream/master-MC1.8.9' into master-MC1.9.4

This commit is contained in:
payonel 2017-08-08 18:47:44 -07:00
commit a4b470e166
4 changed files with 11 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()