diff options
author | Lucas Hoffmann <l-m-h@web.de> | 2018-08-15 12:39:10 +0200 |
---|---|---|
committer | Lucas Hoffmann <l-m-h@web.de> | 2018-08-15 12:39:10 +0200 |
commit | 794e7b43599b4ecb3786de401725ba99087a501e (patch) | |
tree | 0d47612e4107ced760bd704df2b809cf097cd392 /src/nvim/lua/vim.lua | |
parent | ac2d661450f2e54652b6f557b5c1d374e88d006c (diff) | |
download | rneovim-794e7b43599b4ecb3786de401725ba99087a501e.tar.gz rneovim-794e7b43599b4ecb3786de401725ba99087a501e.tar.bz2 rneovim-794e7b43599b4ecb3786de401725ba99087a501e.zip |
API: Use `ps -o comm` in nvim_get_proc()
- The POSIX version of ps(1) only specifies "comm" for the "-o" option
but not "ucomm". See
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html
- On Linux (with the procps-ng package) "ucomm" is an alias for "comm".
See https://gitlab.com/procps-ng/procps
- OpenBSD also has "ucomm" as an alias for "comm" (with the extra note
"Name to be used for accounting."). See https://man.openbsd.org/ps
- FreeBSD describes "ucomm" as "Name to be used for accounting." but
does not say that it should be an alias for "comm". See
https://www.freebsd.org/cgi/man.cgi?query=ps
Diffstat (limited to 'src/nvim/lua/vim.lua')
-rw-r--r-- | src/nvim/lua/vim.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua index e1bbb03d3f..6900313752 100644 --- a/src/nvim/lua/vim.lua +++ b/src/nvim/lua/vim.lua @@ -13,7 +13,7 @@ local function _os_proc_info(pid) if pid == nil or pid <= 0 or type(pid) ~= 'number' then error('invalid pid') end - local cmd = { 'ps', '-p', pid, '-o', 'ucomm=', } + local cmd = { 'ps', '-p', pid, '-o', 'comm=', } local err, name = _system(cmd) if 1 == err and string.gsub(name, '%s*', '') == '' then return {} -- Process not found. |