Skip to content

Commit 262a22d

Browse files
phanenibhagwan
authored andcommitted
feat(mt): use posix execl when possible
1 parent 31dfbe0 commit 262a22d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lua/fzf-lua/libuv.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,11 @@ M.spawn_stdio = function(opts)
422422
io.stdout:write("[DEBUG] [mt] " .. opts.cmd .. EOL)
423423
end
424424

425+
if not fn_transform and not fn_postprocess and not _is_win and opts.cmd and pcall(require, "ffi") then
426+
require("ffi").cdef([[int execl(const char *, const char *, ...);]])
427+
require("ffi").C.execl("/bin/sh", "sh", "-c", opts.cmd, nil) -- noreturn
428+
end
429+
425430
local stderr, stdout = nil, nil
426431

427432
local function stderr_write(msg)

0 commit comments

Comments
 (0)