From f8cfceaaadc4f9f2e53568bceefdd4065b715045 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 1 Apr 2014 09:40:49 -0400 Subject: 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. --- modules/textadept/run.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'modules/textadept/run.lua') 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 -- cgit v1.2.3