aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLucas Hoffmann <lucc@posteo.de>2018-08-18 14:37:29 +0200
committerLucas Hoffmann <lucc@posteo.de>2018-08-18 14:37:33 +0200
commit4d10024a561a20cb2291f5615e4b01957dd955b9 (patch)
tree52126894d6dd94b24486e49f0278993a832116e1 /src
parent794e7b43599b4ecb3786de401725ba99087a501e (diff)
downloadrneovim-4d10024a561a20cb2291f5615e4b01957dd955b9.tar.gz
rneovim-4d10024a561a20cb2291f5615e4b01957dd955b9.tar.bz2
rneovim-4d10024a561a20cb2291f5615e4b01957dd955b9.zip
API: Remove path prefix from command name in nvim_get_proc()
On macOS the output from `ps -o comm` might contain the full path of the executable. The `ucomm` would be the basename only but is less portable (see previous commit).
Diffstat (limited to 'src')
-rw-r--r--src/nvim/lua/vim.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua
index 6900313752..47f40da72e 100644
--- a/src/nvim/lua/vim.lua
+++ b/src/nvim/lua/vim.lua
@@ -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 {