1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-11-10 11:59:59 +00:00

Hide the internal redirect methods in multishell

Previously it was possible to access all methods of the multishell
redirect by calling term.current(). This is definitely not intended, as
it leaks all sorts of internals to the user.

Also bump illuaminate - the new version is about twice as fast on my
machine.
This commit is contained in:
Jonathan Coates 2023-02-12 21:22:39 +00:00
parent 3a6c05688c
commit 33b6f38339
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
2 changed files with 6 additions and 2 deletions

View File

@ -51,7 +51,7 @@ fabric-loom = "1.0-SNAPSHOT"
forgeGradle = "5.1.+" forgeGradle = "5.1.+"
githubRelease = "2.2.12" githubRelease = "2.2.12"
ideaExt = "1.1.6" ideaExt = "1.1.6"
illuaminate = "0.1.0-13-g689d73d" illuaminate = "0.1.0-19-gee6e843"
librarian = "1.+" librarian = "1.+"
minotaur = "2.+" minotaur = "2.+"
mixinGradle = "0.7.+" mixinGradle = "0.7.+"

View File

@ -78,6 +78,11 @@ local function launchProcess(bFocus, tProgramEnv, sProgramPath, ...)
else else
tProcess.window = window.create(parentTerm, 1, 1, w, h, false) tProcess.window = window.create(parentTerm, 1, 1, w, h, false)
end end
-- Restrict the public view of the window to normal redirect functions.
tProcess.terminal = {}
for k in pairs(term.native()) do tProcess.terminal[k] = tProcess.window[k] end
tProcess.co = coroutine.create(function() tProcess.co = coroutine.create(function()
os.run(tProgramEnv, sProgramPath, table.unpack(tProgramArgs, 1, tProgramArgs.n)) os.run(tProgramEnv, sProgramPath, table.unpack(tProgramArgs, 1, tProgramArgs.n))
if not tProcess.bInteracted then if not tProcess.bInteracted then
@ -87,7 +92,6 @@ local function launchProcess(bFocus, tProgramEnv, sProgramPath, ...)
end end
end) end)
tProcess.sFilter = nil tProcess.sFilter = nil
tProcess.terminal = tProcess.window
tProcess.bInteracted = false tProcess.bInteracted = false
tProcesses[nProcess] = tProcess tProcesses[nProcess] = tProcess
if bFocus then if bFocus then