aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/event/libuv_process.c
Commit message (Collapse)AuthorAge
* build(IWYU): fix includes for func_attr.hdundargoc2023-11-27
|
* build(IWYU): fix headers for arabic.hdundargoc2023-11-26
|
* build: rework IWYU mapping filesdundargoc2023-11-25
| | | | | Create mapping to most of the C spec and some POSIX specific functions. This is more robust than relying files shipped with IWYU.
* refactor: enable formatting for ternariesdundargoc2023-11-20
| | | | | | This requires removing the "Inner expression should be aligned" rule from clint as it prevents essentially any formatting regarding ternary operators.
* refactor: iwyu (#26062)zeertzjq2023-11-16
|
* build: remove PVSdundargoc2023-11-12
| | | | | | | We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
* fix(startup): run embedded Nvim with real path (#24282)zeertzjq2023-07-08
| | | fix(startup): run embedded process with real path
* refactor: fix IWYU mapping file and use IWYU (#21802)dundargoc2023-01-15
| | | Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
* fix(embed): handle stdio in server properlybfredl2023-01-09
| | | | | Rename stdin/stdout in the server, so that RPC data won't get corrupted. This also restores the use of stderr to write directly to the terminal.
* fix(tui): more work in the TUIbfredl2022-12-31
|
* feat(tui): run TUI as external processhlpr982022-12-31
|
* build: allow IWYU to fix includes for all .c filesdundargoc2022-11-15
| | | | | | | | | | Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
* vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215)dundargoc2022-09-18
| | | | | | | Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and others. Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the GUI build. (Hirohito Higashi, closes vim/vim#3932) https://github.com/vim/vim/commit/4f97475d326c2773a78561fb874e4f23c25cbcd9
* refactor: format files with uncrustify #15663dundargoc2021-09-14
|
* Add more info to debug messagesJames McCoy2021-04-08
| | | | [skip ci]
* Common handling of required/ignored env varsJames McCoy2021-01-31
| | | | | | | | | | When starting a pty job, there are certain env vars that we need to either add or remove. Currently, there are two relevant scenarios. * Removing irrelevant env vars on Unix, mostly related to the terminal hosting nvim since they do not apply to a libvterm-hosted terminal. * Adding required env vars for Windows jobs.
* Use dict_T to pass env vars to process spawning codeJames McCoy2021-01-31
| | | | Co-authored-by: Matthieu Coudron <mattator@gmail.com>
* Add overlapped option to jobstarterw72020-06-10
| | | | | | | When UV_OVERLAPPED_PIPE was used for the pipe passed to the child process, a problem occurred with the standard input of the .Net Framework application (#11809). Therefore, add the overlapped option to jobstart() and change it so that it is set only when necessary
* jobstart now supports env/clear_envMatthieu Coudron2019-12-11
| | | | to modify the environment of the launched job.
* channels: reflect exit due to signals in exit status code (#10573)Daniel Hahler2019-08-09
| | | | | Uses `128 + term_signal` in case of exit due to a signal. Fixes https://github.com/neovim/neovim/issues/10571.
* win: open child stdio handles in overlapped-mode (#8113)Björn Linse2018-04-25
| | | This will be used e.g. by the python client for native asyncio support
* jobs: child proc must have a separate process-groupJustin M. Keyes2018-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UV_PROCESS_DETACHED compels libuv:uv__process_child_init() to call setsid() in the child just after fork(). That ensures the process and its descendants are grouped in a separate session (and process group). The following jobstart() call correctly groups `sh` and `sleep` in a new session (and process-group), where `sh` is the "session leader" (and process-group leader): :call jobstart(['sh','-c','sleep 60']) SESN PGRP PID PPID Command 30383 30383 30383 3620 │ ├─ -bash 30383 31432 31432 30383 │ │ └─ nvim -u NORC 30383 31432 31433 30383 │ │ ├─ nvim -u NORC 8105 8105 8105 31432 │ │ └─ sh -c sleep 60 8105 8105 8106 8105 │ │ └─ sleep 60 closes #6530 ref: https://stackoverflow.com/q/1046933 ref: https://unix.stackexchange.com/a/404065 Helped-by: Marco Hinz <mh.codebro+github@gmail.com> Discussion ------------------------------------------------------------------------ On my linux box before this patch, the termclose_spec.lua:'kills job trapping SIGTERM' test indirectly causes cmake/busted to wait for 60s. That's because the test spawns a `sleep 60` descendant process which hangs around even after nvim exits: nvim killed the parent PID, but not PGID (process-group), so the grandchild "reparented" to init (PID 1). Session contains processes (and process-groups) which are logically part of the same "login session". Process-group is a set of logically/informally-related processes within a session; for example, shells assign a process group to each "job". Session IDs and PGIDs both have type pid_t (like PIDs). These OS-level mechanisms are, as usual, legacy accidents whose purpose is upheld by convention and folklore. We can use session-level grouping (setsid), or we could use process-group-level grouping (setpgid). Vim uses setsid() if available, otherwise setpgid(0,0). Windows ------------------------------------------------------------------------ UV_PROCESS_DETACHED on win32 sets CREATE_NEW_PROCESS_GROUP flag. But uv_kill() does not kill the process-group: https://github.com/nodejs/node/issues/3617 Ideas: - Set UV_PROCESS_DETACHED (CREATE_NEW_PROCESS_GROUP), then call GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, pid) - Maybe won't work because MSDN says "Only processes that share the same console as the calling process receive the signal." https://docs.microsoft.com/en-us/windows/console/generateconsolectrlevent But CREATE_NEW_PROCESS_GROUP creates a new console ... ref https://stackoverflow.com/q/1453520 - Group processes within a "job". libuv does that *globally* for non-detached processes: uv__init_global_job_handle. - Iterate through CreateToolhelp32Snapshot(). - https://stackoverflow.com/q/1173342 - Vim does this, see terminate_all()
* channels: refactorBjörn Linse2017-11-24
|
* process_close(): uv_unref() detached processes (#7539)Justin M. Keyes2017-11-12
| | | | | | | Doc for UV_PROCESS_DETACHED in uv.h mentions: > child process will still keep the parent's event loop alive unless > the parent process calls uv_unref() on the child's process handle. ref #3944
* *: Fix all V641 errorsZyX2017-05-20
|
* *: Add comment to all C filesZyX2017-04-19
|
* win: os_shell_is_cmdexe() + testsJustin M. Keyes2017-04-12
|
* win: libuv_process_spawn(): special-case cmd.exeRui Abreu Ferreira2017-04-12
| | | | | | | | | | | | | | | | | | Disable CommandLineToArgvW-standard quoting for cmd.exe. libuv assumes spawned processes follow the convention expected by CommandLineToArgvW(). But cmd.exe is non-conformant, so for cmd.exe: - With system([]), the caller has full control (and responsibility) to quote arguments correctly. - With system(''), shell* options are used. libuv quoting is disabled if argv[0] is: - cmd.exe - cmd - $COMSPEC resolving to a path with filename cmd.exe Closes #6329 References #6387
* process_spawn: Return status code (#6075)Justin M. Keyes2017-02-09
|
* Windows: libuv_process_spawn(): Allow libuv argument quoting/escaping.Rui Abreu Ferreira2017-01-10
| | | | | | | | | | | Closes #5360 References #3305 Reverts commit dc9652e68de163290abee880a74bf1727c715a1e. Disabling the quoting was does not solve the problem in general, and we would end up having to handle the quoting ourselves. See: https://github.com/JuliaLang/julia/issues/13776
* eval: allow setting cwd in {jobstart,termopen}()Aleksa Sarai2016-06-07
| | | | | | | | | | | Processes in vim are always started in the current directory, which causes issues when the process is a daemon and the current directory is a mountpoint. Fix this by adding an option to set the cwd of the new process with jobstart(). In addition, fix termopen() so that it actually uses the cwd option from the dict (it couldn't previously set the cwd value due to dead code). Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
* job control: add 'detach' option to jobstartBjörn Linse2016-01-20
|
* Windows: disable libuv argument escaping for uv_spawn #3305Rui Abreu Ferreira2015-09-08
| | | | | | When calling uv_spawn to launch a process set the libuv process flag UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS to disable escaping for the arguments otherwise libuv will wrap arguments in quotes.
* Windows: avoid "uv_" naming conflicts. #3225Seth Jackson2015-08-27