diff options
Diffstat (limited to 'src/nvim/event/process.h')
-rw-r--r-- | src/nvim/event/process.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h index 39fed08c77..69fe229b0e 100644 --- a/src/nvim/event/process.h +++ b/src/nvim/event/process.h @@ -32,6 +32,7 @@ struct process { uint64_t stopped_time; // process_stop() timestamp const char *cwd; char **argv; + const char *exepath; dict_T *env; Stream in, out, err; /// Exit handler. If set, user must call process_free(). @@ -54,6 +55,7 @@ static inline Process process_init(Loop *loop, ProcessType type, void *data) .stopped_time = 0, .cwd = NULL, .argv = NULL, + .exepath = NULL, .in = { .closed = false }, .out = { .closed = false }, .err = { .closed = false }, @@ -66,6 +68,12 @@ static inline Process process_init(Loop *loop, ProcessType type, void *data) }; } +/// Get the path to the executable of the process. +static inline const char *process_get_exepath(Process *proc) +{ + return proc->exepath != NULL ? proc->exepath : proc->argv[0]; +} + static inline bool process_is_stopped(Process *proc) { bool exited = (proc->status >= 0); |