aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
| * | | | | | | | vim-patches: test_system.vimJustin M. Keyes2018-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vim-patch:8.0.0185: system() test fails on MS-Windows vim-patch:8.0.0197: system() test skips some parts for MS-Windows vim-patch:8.0.0701: system test failing when using X11 forwarding
| * | | | | | | | vim-patch:8.0.0184: fix ex-mode exit code #7943sohnryang2018-03-24
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: When in Ex mode and an error is caught by try-catch, Vim still exits with a non-zero exit code. Solution: Don't set ex_exitval when inside a try-catch. (partly by Christian Brabandt) https://github.com/vim/vim/commit/2b7bc567b9238aaac682236cb4f727d0376e1302
* | | | | | | | win: defaults: 'shellcmdflag', 'shellxquote' #7343Jan Edmund Lazo2018-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | closes #7698 Wrapping a command in double-quotes allows cmd.exe to safely dequote the entire command as if the user entered the entire command in an interactive prompt. This reduces the need to escape nested and uneven double quotes. The `/s` flag of cmd.exe makes the behaviour more reliable: :set shellcmdflag=/s\ /c Before this patch, cmd.exe cannot use cygwin echo.exe (as opposed to cmd.exe `echo` builtin) even if it is wrapped in double quotes. Example: :: internal echo > cmd /s /c " echo foo\:bar" " foo\:bar" :: cygwin echo.exe > cmd /s /c " "echo" foo\:bar" " foo:bar
* | | | | | | | build/msvc: Add libintl to bundled dependencies (#8163)b-r-o-c-k2018-03-24
| | | | | | | |
* | | | | | | | Merge #4419 'implement <Cmd> key'Justin M. Keyes2018-03-24
|\ \ \ \ \ \ \ \
| * | | | | | | | getchar: implement <Cmd> key to invoke command in any modeBjörn Linse2018-03-23
| | | | | | | | |
* | | | | | | | | Merge #8168 'refactor: rename some functions'Justin M. Keyes2018-03-24
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | refactor/rename: path_to_absolute()Justin M. Keyes2018-03-24
| | | | | | | | | |
| * | | | | | | | | refactor/rename: path_try_shorten_fname()Justin M. Keyes2018-03-24
| | | | | | | | | |
| * | | | | | | | | refactor/rename: path_is_absolute()Justin M. Keyes2018-03-24
|/ / / / / / / / /
* | | | | | | | | Merge #8165 'provider/RPC: fix double-free'Justin M. Keyes2018-03-24
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | refactor: eliminate `autocmd_fname_full` globalJustin M. Keyes2018-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a micro-optimization; check path_is_absolute_path(autocmd_fname) instead. The main optimization (which is still in place) afforded by Vim 7.2.021 was to avoid resolving <afile> when it is not needed.
| * | | | | | | | | provider/RPC: apply_autocmds_group(): fix double-freeJustin M. Keyes2018-03-24
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During provider dispatch, eval_call_provider() saves global state--including pointers, such as `autocmd_fname`--into `provider_caller_scope` which is later restored by f_rpcrequest(). But `autocmd_fname` is special-cased in eval_vars(), for performance (see Vim patch 7.2.021; this is also the singular purpose of the `autocmd_fname_full` global. Yay!) If eval_vars() frees `autocmd_fname` then its provider-RPC-scoped alias becomes a problem. Solution: Don't free autocmd_fname in eval_vars(), just copy into it. closes #5245 closes #5617 Reference ------------------------------------------------------------------------ Vim patch 7.2.021 https://github.com/vim/vim/commit/f6dad43c98f47da1ff9d8c99b320fc3674f83c63 Problem: When executing autocommands getting the full file name may be slow. (David Kotchan) Solution: Postpone calling FullName_save() until autocmd_fname is used. vim_dev discussion (2008): "Problem with CursorMoved AutoCommand when Editing Files on a Remote WIndows Share" https://groups.google.com/d/msg/vim_dev/kj95weZa_eE/GTgj4aq5sIgJ
* / / / / / / / / vim-patch:8.0.0387: compiler warnings (#8162)KunMing Xie2018-03-23
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: compiler warnings Solution: Add type casts. (Christian Brabandt) https://github.com/vim/vim/commit/b113c3a618113122e62697dd73427261f8c51b2c
* | | | | | | | vim-patch:8.0.0357: crash when setting 'guicursor' to weird value (#8161)KunMing Xie2018-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Crash when setting 'guicursor' to weird value. Solution: Avoid negative size. (Dominique Pelle, closes vim/vim#1465) https://github.com/vim/vim/commit/24922ec23360e7ea7c5a803c9edf476bb6395b32
* | | | | | | | Merge #8147 'Run old tests in :terminal'Justin M. Keyes2018-03-21
|\ \ \ \ \ \ \ \
| * | | | | | | | oldtests: Make test output least verboseZyX2018-03-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also removes `-` before `rm -rf` as `-f` is supposed to already suppress error.
| * | | | | | | | oldtests: Run old tests in :terminalZyX2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reasoning: - No need to check for terminal size. - No need to mess with terminal title. - Allows old tests to timeout with the rest of the build proceeding. - Less and less messy output to travis log. - Opens a path allowing old tests run in parallel. Though last bit needs test refactoring.
* | | | | | | | | build/cmake: avoid CMP0054 (#8149)Justin M. Keyes2018-03-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | CMP0054: Only interpret if() arguments as variables or keywords when unquoted.
* | | | | | | | | Merge #8128 'build/windows: Simplify build requirements'Justin M. Keyes2018-03-18
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | build: avoid CMP0046 "dependency target does not exist" #8128Justin M. Keyes2018-03-18
| | | | | | | | | |
| * | | | | | | | | build: Fix CMake target dependency problemb-r-o-c-k2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nvim was being ran before its runtime dependencies were copied.
| * | | | | | | | | build/windows: Add CMakeLists.txt for gperfb-r-o-c-k2018-03-18
| | | | | | | | | |
| * | | | | | | | | build/windows: Add CMake script to generate headers for Libvtermb-r-o-c-k2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows the CMake script will replace the Perl script used by Libvterm to generate headers.
| * | | | | | | | | build/windows: Add CMakeLists.txt for Libuv on Windowsb-r-o-c-k2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding a CMakeLists.txt for Libuv removes the need for Python when building on Windows.
| * | | | | | | | | build/windows: Ignore whitespace when applying patchesb-r-o-c-k2018-03-18
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The --ignore-whitespace argument was added when applying patches to prevent failures when patched files have different line endings.
* / / / / / / / / log/channels: Formatting. Also log loopback channel. #8146Justin M. Keyes2018-03-18
|/ / / / / / / /
* | | | | | | | Merge #8107 'jobs: separate process-group'Justin M. Keyes2018-03-18
|\ \ \ \ \ \ \ \
| * | | | | | | | test/win: use cmd.exe for testJustin M. Keyes2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Can revert this after #8120.
| * | | | | | | | test: jobstop() kills entire process treeJustin M. Keyes2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test correctly fails before 8d90171f8be6. ref #6530
| * | | | | | | | API: nvim_get_proc()Justin M. Keyes2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TODO: "exepath" field (win32: QueryFullProcessImageName()) On unix-likes `ps` is used because the platform-specific APIs are a nightmare. For reference, below is a (incomplete) attempt: diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c index 09769925aca5..99afbbf290c1 100644 --- a/src/nvim/os/process.c +++ b/src/nvim/os/process.c @@ -208,3 +210,60 @@ int os_proc_children(int ppid, int **proc_list, size_t *proc_count) return 0; } +/// Gets various properties of the process identified by `pid`. +/// +/// @param pid Process to inspect. +/// @return Map of process properties, empty on error. +Dictionary os_proc_info(int pid) +{ + Dictionary pinfo = ARRAY_DICT_INIT; +#ifdef WIN32 + +#elif defined(__APPLE__) + char buf[PROC_PIDPATHINFO_MAXSIZE]; + if (proc_pidpath(pid, buf, sizeof(buf))) { + name = getName(buf); + PUT(pinfo, "exepath", STRING_OBJ(cstr_to_string(buf))); + return name; + } else { + ILOG("proc_pidpath() failed for pid: %d", pid); + } +#elif defined(BSD) +# if defined(__FreeBSD__) +# define KP_COMM(o) o.ki_comm +# else +# define KP_COMM(o) o.p_comm +# endif + struct kinfo_proc *proc = kinfo_getproc(pid); + if (proc) { + PUT(pinfo, "name", cstr_to_string(KP_COMM(proc))); + xfree(proc); + } else { + ILOG("kinfo_getproc() failed for pid: %d", pid); + } + +#elif defined(__linux__) + char fname[256] = { 0 }; + char buf[MAXPATHL]; + snprintf(fname, sizeof(fname), "/proc/%d/comm", pid); + FILE *fp = fopen(fname, "r"); + // FileDescriptor *f = file_open_new(&error, fname, kFileReadOnly, 0); + // ptrdiff_t file_read(FileDescriptor *const fp, char *const ret_buf, + // const size_t size) + if (fp == NULL) { + ILOG("fopen() of /proc/%d/comm failed", pid); + } else { + size_t n = fread(buf, sizeof(char), sizeof(buf) - 1, fp); + if (n == 0) { + WLOG("fread() of /proc/%d/comm failed", pid); + } else { + size_t end = MIN(sizeof(buf) - 1, n); + end = (end > 0 && buf[end - 1] == '\n') ? end - 1 : end; + buf[end] = '\0'; + PUT(pinfo, "name", STRING_OBJ(cstr_to_string(buf))); + } + } + fclose(fp); +#endif + return pinfo; +}
| * | | | | | | | win: nvim_get_proc_children()Justin M. Keyes2018-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TODO: Raymond Chen explains[1] racy behavior of the CreateToolhelp32Snapshot approach. Better approach: > create a job object and put process P in it. Then call > QueryInformationJobObject with JobObjectBasicProcessIdList to get the > list of child processes. [1] "Why is CreateToolhelp32Snapshot returning incorrect parent process IDs all of a sudden?" https://blogs.msdn.microsoft.com/oldnewthing/20150403-00/?p=44313
| * | | | | | | | nvim_get_proc_children: fallback to shellJustin M. Keyes2018-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | /proc/…/children may be unavailable because of an unset kernel option. Fallback to `pgrep` invoked in a shell.
| * | | | | | | | API: nvim_get_proc_children()Justin M. Keyes2018-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ref https://github.com/libuv/libuv/pull/836
| * | | | | | | | win: os_proc_tree_kill()Justin M. Keyes2018-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | XXX: comment at https://stackoverflow.com/q/1173342 : > Windows recycles PIDs quite fast, you have to be extra careful not > to kill unrelated processes. These APIs will report PPIDs for long > dead processes whose PIDs may have been recycled. Check the parent > start date to make sure it is related to the processes you spawned.
| * | | | | | | | 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()
| * | | | | | | | test: use luv.now() instead of os.time()Justin M. Keyes2018-03-16
| | | | | | | | |
* | | | | | | | | screen.c: define column width by function (#5802)Matthieu Coudron2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does not change the behavior but centralizes column size for future use (like dynamic signcolumn width depending on the maximum number of signs on a line). The returned value is limited by the size of the `extra` tab in win_line (currently allows for 18 ASCII characters).
* | | | | | | | | Merge #8142 'build/msvc: fix some warnings'Justin M. Keyes2018-03-18
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | build/MSVC: fix "C4005: RGB: macro redefinition"Justin M. Keyes2018-03-18
| | | | | | | | | |
| * | | | | | | | | build/MSVC: fix "C4003: not enough actual parameters for macro"Justin M. Keyes2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the case of TV_DICTITEM_STRUCT, we can't just pass `1` because: https://github.com/neovim/neovim/pull/8142#discussion_r175262436 > this variant will trigger array overrun warnings from various static analyzers.
| * | | | | | | | | build/MSVC: fix "C4028: formal parameter different from declaration"Justin M. Keyes2018-03-18
| | | | | | | | | |
| * | | | | | | | | ci/travis: report cache sizeJustin M. Keyes2018-03-18
| | | | | | | | | |
| * | | | | | | | | ci/travis: also cache $DEPS_DOWNLOAD_DIRJustin M. Keyes2018-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ref #5166
| * | | | | | | | | ci/travis: Don't destroy cache during prepareJustin M. Keyes2018-03-17
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change was missed in c7f95fde1bb1. ref #5166
* / / / / / / / / vim-patch:8.0.0344: unlet command leaks memory (#8141)KunMing Xie2018-03-17
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Unlet command leaks memory. (Nikolai Pavlov) Solution: Free the memory on error. (closes vim/vim#1497) https://github.com/vim/vim/commit/49439c4cdf7d2822255f292adda4226656fe144d
* | | | | | | | DirChanged: support <buffer> (#8140)Marco Hinz2018-03-16
| | | | | | | |
* | | | | | | | doc: nodejsJustin M. Keyes2018-03-15
| | | | | | | |
* | | | | | | | node/provider: support g:node_host_prog #8135chemzqm2018-03-15
| |_|_|_|_|_|/ |/| | | | | |
* | | | | | | vim-patch:8.0.0316: :help z? does not work (#8134)KunMing Xie2018-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ":help z?" does not work. (Pavol Juhas) Solution: Remove exception for z?. https://github.com/vim/vim/commit/dad7309dd22f0c6b5de0b031acd7f54d3aa94326