mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 16:58:17 +00:00
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).
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user