Skip to content

Commit

Permalink
ChildProcessStream: store exitcode/exitsignal
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Oct 10, 2019
1 parent dc5b731 commit 7fa9fa5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion nvim/child_process_stream.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ function ChildProcessStream.spawn(argv, env)
stdio = {self._child_stdin, self._child_stdout, 2},
args = args,
env = env,
}, function()
}, function(code, signal)
self.exitcode = code
self.exitsignal = signal
self:close()
end)

Expand Down
7 changes: 6 additions & 1 deletion nvim/session.lua
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@ function Session:_run(request_cb, notification_cb, timeout)
self._prepare:stop()
end)
end
self._msgpack_rpc_stream:read_start(request_cb, notification_cb, uv.stop)
self._msgpack_rpc_stream:read_start(request_cb, notification_cb, function()
uv.run() -- run the loop to get exitcode from child process.
self.child_exit = self._msgpack_rpc_stream._stream.exitcode
self.child_signal = self._msgpack_rpc_stream._stream.exitsignal
uv.stop()
end)
uv.run()
self._prepare:stop()
self._timer:stop()
Expand Down

0 comments on commit 7fa9fa5

Please sign in to comment.