term: term_init: add 'cwd' argument

This is used when spawning the slave, to set its current working
directory just before we exec() the client.

In a regular foot instance, we set the cwd from getcwd().

In a foot server instance, each connecting client sends its cwd to the
server, and we use that.
This commit is contained in:
Daniel Eklöf 2019-12-21 19:57:28 +01:00
parent 277735db65
commit 39146fac5c
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 28 additions and 18 deletions

View file

@ -4,4 +4,5 @@
#include <sys/types.h>
pid_t slave_spawn(
int ptmx, int argc, char *const *argv, const char *term_env, const char *conf_shell);
int ptmx, int argc, const char *cwd, char *const *argv, const char *term_env,
const char *conf_shell);