aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2014-04-01 09:40:49 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2014-04-01 09:40:49 -0400
commitf8cfceaaadc4f9f2e53568bceefdd4065b715045 (patch)
tree82eb5e3e82c5c2762a941a2efb7a3c4d05f20481 /modules/textadept
parent5ee0a05a9abb104da692054596c707c9cf5fe44b (diff)
downloadtextadept-f8cfceaaadc4f9f2e53568bceefdd4065b715045.tar.gz
textadept-f8cfceaaadc4f9f2e53568bceefdd4065b715045.zip
Workaround for GTKOSX abort; modules/textadept/run.lua
There is a failed assertion related to file descriptors which is somehow caused by executing a Lua callback on process exit. If there is no Lua callback, there is no abort. Closing file descriptors before executing the Lua callback has no effect.
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/run.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index b9a92aae..a4b5f189 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -112,13 +112,20 @@ local function command(commands, event)
end
ui.SILENT_PRINT = false
end
+ local function emit_status(status) emit_output('> exit status: '..status) end
if commands == M.build_commands then emit_output('> cd '..cwd) end
emit_output('> '..command)
- local p, err = spawn(command, cwd, emit_output, emit_output, function(status)
- emit_output('> exit status: '..status)
- end)
+ local p, err = spawn(command, cwd, emit_output, emit_output,
+ not OSX and emit_status or nil)
if not p then error(err) end
+ if OSX then
+ -- Workaround for GTKOSX abort caused by failed assertion.
+ timeout(1, function()
+ if p:status() == 'running' then return true end
+ emit_status('Process completed')
+ end)
+ end
M.proc, M.cwd = p, cwd
end