diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2018-08-20 18:12:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-20 18:12:19 +0200 |
commit | 768bc68d7eebbdb63a80c6cc3d81152cce755111 (patch) | |
tree | 5450e77040cf770cd40375180c928254627e3ce9 | |
parent | c05d7153d3158877510b9490247751127b6af813 (diff) | |
parent | 4d10024a561a20cb2291f5615e4b01957dd955b9 (diff) | |
download | rneovim-768bc68d7eebbdb63a80c6cc3d81152cce755111.tar.gz rneovim-768bc68d7eebbdb63a80c6cc3d81152cce755111.tar.bz2 rneovim-768bc68d7eebbdb63a80c6cc3d81152cce755111.zip |
Merge #8860 from lucc/nvim_get_proc
-rw-r--r-- | src/nvim/lua/vim.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua index e1bbb03d3f..47f40da72e 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. @@ -23,7 +23,7 @@ local function _os_proc_info(pid) end local _, ppid = _system({ 'ps', '-p', pid, '-o', 'ppid=', }) -- Remove trailing whitespace. - name = string.gsub(name, '%s+$', '') + name = string.gsub(string.gsub(name, '%s+$', ''), '^.*/', '') ppid = string.gsub(ppid, '%s+$', '') ppid = tonumber(ppid) == nil and -1 or tonumber(ppid) return { |