summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_system.lua
AgeCommit message (Collapse)AuthorFiles
2025-12-30build: ship "_core/*" as bytecode (built-into Nvim binary)Justin M. Keyes1
Problem: We want to encourage implementing core features in Lua instead of C, but it's clumsy because: - Core Lua code (built into `nvim` so it is available even if VIMRUNTIME is missing/invalid) requires manually updating CMakeLists.txt, or stuffing it into `_editor.lua`. - Core Lua modules are not organized similar to C modules, `_editor.lua` is getting too big. Solution: - Introduce `_core/` where core Lua code can live. All Lua modules added there will automatically be included as bytecode in the `nvim` binary. - Move these core modules into `_core/*`: ``` _defaults.lua _editor.lua _options.lua _system.lua shared.lua ``` TODO: - Move `_extui/ => _core/ui2/`
2025-10-12docs: small fixes (#36146)zeertzjq1
Close #35989 Close #36031 Close #36107 Co-authored-by: Kieran Moy <kfatyuip@gmail.com> Co-authored-by: William Sprent <william@sprent.dk> Co-authored-by: David Briscoe <43559+idbrii@users.noreply.github.com>
2025-09-16docs: small fixes (#35791)zeertzjq1
Close #34938 Close #35030 Close #35233 Close #35259 Close #35290 Close #35433 Close #35541 Close #35766 Close #35792 Co-authored-by: huylg <45591413+huylg@users.noreply.github.com> Co-authored-by: Jason Del Ponte <961963+jasdel@users.noreply.github.com> Co-authored-by: sooriya <74165167+thuvasooriya@users.noreply.github.com> Co-authored-by: Andrew Braxton <andrewcbraxton@gmail.com> Co-authored-by: Enric Calabuig <enric.calabuig@gmail.com> Co-authored-by: Augusto César Dias <augusto.c.dias@gmail.com> Co-authored-by: David Sierra DiazGranados <davidsierradz@gmail.com> Co-authored-by: Stepan Nikitin <90522882+vectravox@users.noreply.github.com> Co-authored-by: Emilien Breton <bricktech2000@gmail.com>
2025-07-28docs: lsp, ui events, dev guidance, osc7Justin M. Keyes1
fix #34981
2025-07-10docs: move vim.system to own sectionLewis Russell1
2025-07-02fix(vim.system): env=nil passes env=nil to uv.spawnLewis Russell1
731e616a79 made it so passing `{env = nil, clear_env = true }` would pass `{env = {}}` to `vim.uv.spawn`. However this is not what `clear_env` is (arguably) supposed to do. If `env=nil` then that implies the uses wants `vim.uv.spawn()` to use the default environment. Adding `clear_env = true` simply prevents `NVIM` (the base environment) from being added. Fixes #34730
2025-06-25fix(vim.system): clear_env=true gives an invalid env to uv.spawn #33955Birdee1
Problem: In setup_env, some needed logic is bypassed when clear_env=true. Solution: Drop the early return in setup_env(). Co-authored-by: BirdeeHub <birdee@localhost>
2025-06-06fix: type fixesLewis Russell1
Type fixes caught by emmylua
2025-05-29fix(vim.system): improve error message when cwd does not existLewis Russell1
Problem: vim.uv.spawn will emit ENOENT for either when the cmd or cwd do not exist and does not tell you which. Solution: If an error occurs, check if cwd was supplied and included in the error message if it does not exist.
2025-05-06docs(luv): replace bundled LuaCATS meta files with upstreamChristian Clason1
Synced from https://github.com/luvit/luv/blob/master/meta.lua
2025-04-16fix(vim.system): unclear non-executable message #33455Justin M. Keyes1
Problem: When a command is not found or not executable, the error message gives no indication about what command was actually tried. Solution: Always append the command name to the error message. BEFORE: E5108: Error executing lua …/_system.lua:248: ENOENT: no such file or directory AFTER: E5108: Error executing lua …/_system.lua:249: ENOENT: no such file or directory: "foo" fix #33445
2024-12-20fix(vim.system): invalid MAX_TIMEOUT for 32-bit systems #31638Dan Pascu1
The maximum signed value on 32-bit systems is 2 ^ 31 - 1. When using 2 ^ 31 for the default timeout, the value would overflow on such systems resulting in a negative value, which caused a stack trace when calling wait() without a timeout.
2024-12-04fix(vim.system): close pipe handles after process handleLewis Russell1
Fixes #30846
2024-11-08fix(vim.system): resolve executable paths on windowsLewis Russell1
Fixes #31107
2024-10-17perf(validate): use lighter versionLewis Russell1
- Also fix `vim.validate()` for PUC Lua when showing errors for values that aren't string or number.
2024-04-15fix(vim.ui): open() may wait indefinitely #28325Justin M. Keyes1
Problem: vim.ui.open "locks up" Nvim if the spawned process does not terminate. #27986 Solution: - Change `vim.ui.open()`: - Do not call `wait()`. - Return a `SystemObj`. The caller can decide if it wants to `wait()`. - Change `gx` to `wait()` only a short time. - Allows `gx` to show a message if the command fails, without the risk of waiting forever.
2024-02-02fix(vim.system): don't process non-fast events during wait() (#27300)zeertzjq1
Problem: Processing non-fast events during SystemObj:wait() may cause two pieces of code to interfere with each other, and is different from jobwait(). Solution: Don't process non-fast events during SystemObj:wait().
2024-01-14fix(lsp): fix incorrect typing and doc for `vim.lsp.rpc`Jongwook Choi1
Typings introduced in #26032 and #26552 have a few conflicts, so we merge and clean them up. We also fix some incorrect type annotation in the `vim.lsp.rpc` package. See the associated PR for more details. Summary: - vim.rpc.Dispatchers -> vim.lsp.rpc.Dispatchers - vim.lsp.rpc.Error -> lsp.ResponseError - Revise docs
2024-01-11fix(doc): improve doc generation of types using lpegLewis Russell1
Added a lpeg grammar for LuaCATS and use it in lua2dox.lua
2023-09-05fix: windows timeouts have exit code 1Lewis Russell1
2023-09-05refactor(vim.system): factor out on_exit handlingLewis Russell1
2023-09-05fix(vim.system): make timeout work properlyLewis Russell1
Mimic the behaviour of timeout(1) from coreutils.
2023-09-05fix(vim.system): let on_exit handle cleanup after killLewis Russell1
Fixes #25000
2023-08-09fix(lua): improve annotations for stricter luals diagnostics (#24609)Christian Clason1
Problem: luals returns stricter diagnostics with bundled luarc.json Solution: Improve some function and type annotations: * use recognized uv.* types * disable diagnostic for global `vim` in shared.lua * docs: don't start comment lines with taglink (otherwise LuaLS will interpret it as a type) * add type alias for lpeg pattern * fix return annotation for `vim.secure.trust` * rename local Range object in vim.version (shadows `Range` in vim.treesitter) * fix some "missing fields" warnings * add missing required fields for test functions in eval.lua * rename lsp meta files for consistency
2023-07-18docs(lua): more improvements (#24387)Lewis Russell1
* docs(lua): teach lua2dox how to table * docs(lua): teach gen_vimdoc.py about local functions No more need to mark local functions with @private * docs(lua): mention @nodoc and @meta in dev-lua-doc * fixup! Co-authored-by: Justin M. Keyes <justinkz@gmail.com> --------- Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2023-07-06fix(vim.system): close check handle (#24270)zeertzjq1
Fix hang after running vim.system() with sanitizers.
2023-06-07feat(lua): add `vim.system()`Lewis Russell1
feat(lua): add vim.system() Problem: Handling system commands in Lua is tedious and error-prone: - vim.fn.jobstart() is vimscript and comes with all limitations attached to typval. - vim.loop.spawn is too low level Solution: Add vim.system(). Partly inspired by Python's subprocess module Does not expose any libuv objects.