aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/pty_process_unix.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-06-10 03:05:28 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-06-10 03:05:28 -0400
commita160590e40342f013b7da45d2ab0e1c6ed636d35 (patch)
treeacb505c22c42bf35612715c6aa9777feb7ec4ea2 /src/nvim/os/pty_process_unix.c
parent5832809344e54b7d0253457b63173b8ac7dbb4db (diff)
parent96546fb69636bd53d8f72d193af709f13af75b68 (diff)
downloadrneovim-a160590e40342f013b7da45d2ab0e1c6ed636d35.tar.gz
rneovim-a160590e40342f013b7da45d2ab0e1c6ed636d35.tar.bz2
rneovim-a160590e40342f013b7da45d2ab0e1c6ed636d35.zip
Merge #4813 'runtime: clipboard: start daemons in /'.
Diffstat (limited to 'src/nvim/os/pty_process_unix.c')
-rw-r--r--src/nvim/os/pty_process_unix.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c
index d0a38e663b..436de030ba 100644
--- a/src/nvim/os/pty_process_unix.c
+++ b/src/nvim/os/pty_process_unix.c
@@ -28,6 +28,7 @@
#include "nvim/event/process.h"
#include "nvim/os/pty_process_unix.h"
#include "nvim/log.h"
+#include "nvim/os/os.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "os/pty_process_unix.c.generated.h"
@@ -131,6 +132,12 @@ static void init_child(PtyProcess *ptyproc) FUNC_ATTR_NONNULL_ALL
signal(SIGTERM, SIG_DFL);
signal(SIGALRM, SIG_DFL);
+ Process *proc = (Process *)ptyproc;
+ if (proc->cwd && os_chdir(proc->cwd) != 0) {
+ fprintf(stderr, "chdir failed: %s\n", strerror(errno));
+ return;
+ }
+
setenv("TERM", ptyproc->term_name ? ptyproc->term_name : "ansi", 1);
execvp(ptyproc->process.argv[0], ptyproc->process.argv);
fprintf(stderr, "execvp failed: %s\n", strerror(errno));