diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-09-05 14:38:57 +0100 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2023-09-05 17:10:04 +0100 |
commit | be8b15200d7093726b0999ccfd4a3e9952656d47 (patch) | |
tree | fa55aba30d246d8bddb884843d5a3d6076ca6ee8 /runtime/lua/vim/_system.lua | |
parent | 80d1333b7317460c562a982ac21f900d9fbd89f6 (diff) | |
download | rneovim-be8b15200d7093726b0999ccfd4a3e9952656d47.tar.gz rneovim-be8b15200d7093726b0999ccfd4a3e9952656d47.tar.bz2 rneovim-be8b15200d7093726b0999ccfd4a3e9952656d47.zip |
fix: windows timeouts have exit code 1
Diffstat (limited to 'runtime/lua/vim/_system.lua')
-rw-r--r-- | runtime/lua/vim/_system.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/lua/vim/_system.lua b/runtime/lua/vim/_system.lua index 5ea0071215..9279febddf 100644 --- a/runtime/lua/vim/_system.lua +++ b/runtime/lua/vim/_system.lua @@ -277,7 +277,9 @@ local function _on_exit(state, code, signal, on_exit) state.done = true end - if code == 0 and state.done == 'timeout' then + if (code == 0 or code == 1) and state.done == 'timeout' then + -- Unix: code == 0 + -- Windows: code == 1 code = 124 end @@ -326,10 +328,12 @@ function M.run(cmd, opts, on_exit) stderr = stderr, } + --- @diagnostic disable-next-line:missing-fields state.handle, state.pid = spawn(cmd[1], { args = vim.list_slice(cmd, 2), stdio = { stdin, stdout, stderr }, cwd = opts.cwd, + --- @diagnostic disable-next-line:assign-type-mismatch env = setup_env(opts.env, opts.clear_env), detached = opts.detach, hide = true, |