mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-07 04:34:03 -05:00
client: add -E,--client-environment
When this option is used, the child process in the new terminal instance will inherit its environment from the footclient process, instead of the foot server’s. Implemented by sending (yet another) dynamic string list as part of the client -> server setup packet. When the new option is *not* used, the setup packet is now 2 bytes larger than before. On the server side, the slave process now uses execvpe() instead of execvp(). There’s plumbing to propagate a new ‘envp’ argument from term_init() all the way down to slave_exec(). If ‘envp’ is NULL, we use ‘environ’ instead (thus matching the old behavior of execvp()). Closes #1004
This commit is contained in:
parent
856086bbbe
commit
d02124902b
9 changed files with 100 additions and 39 deletions
|
|
@ -1034,7 +1034,7 @@ static void fdm_client_terminated(
|
|||
struct terminal *
|
||||
term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper,
|
||||
struct wayland *wayl, const char *foot_exe, const char *cwd,
|
||||
const char *token, int argc, char *const *argv,
|
||||
const char *token, int argc, char *const *argv, char *const *envp,
|
||||
void (*shutdown_cb)(void *data, int exit_code), void *shutdown_data)
|
||||
{
|
||||
int ptmx = -1;
|
||||
|
|
@ -1241,7 +1241,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper,
|
|||
|
||||
/* Start the slave/client */
|
||||
if ((term->slave = slave_spawn(
|
||||
term->ptmx, argc, term->cwd, argv,
|
||||
term->ptmx, argc, term->cwd, argv, envp,
|
||||
conf->term, conf->shell, conf->login_shell,
|
||||
&conf->notifications)) == -1)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue