diff options
Diffstat (limited to '')
| -rw-r--r-- | client-protocol.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/client-protocol.h b/client-protocol.h index efd601d7..391fb6d1 100644 --- a/client-protocol.h +++ b/client-protocol.h @@ -9,6 +9,27 @@ struct client_string { /* char str[static len]; */ }; +/* + * Data + options sent from client to server + * + * - hold: don't exit (the terminal instance) after the slave has terminated + * - no-wait: terminate the footclient instance immediately + * - xdga-token: for activation + * - exe: the filename/path to use when spawning a new footclient instance (used by spawn-terminal) + * - cwd: current working directory of the footclient process + * - overrides: -o style options + * - foot-argc/argv: the raw footclient command line, no processing + * - slave-argc/argv: argc+argv passed to the slave + * - envp: footclient's environment, copied to the server + * + * Note that almost everything can be derived from foot argc/argv. In + * the future, we _could_ strip the protocol, and do most of the + * command line parsing inside the server. For a very long time, foot + * argc/argv was *not* part of the protocol, but was added to allow + * spawn-terminal to spawn a new footclient instance with the exact + * same command line options. + */ + struct client_data { bool hold:1; bool no_wait:1; @@ -16,19 +37,23 @@ struct client_data { uint8_t reserved:5; uint8_t token_len; + uint16_t exe_len; uint16_t cwd_len; uint16_t override_count; - uint16_t argc; + uint16_t foot_argc; + uint16_t slave_argc; uint16_t env_count; + /* char exe[static exe_len]; */ /* char cwd[static cwd_len]; */ /* char token[static token_len]; */ /* struct client_string overrides[static override_count]; */ - /* struct client_string argv[static argc]; */ + /* struct client_string foot_argv[static foot_argc]; */ + /* struct client_string slave_argv[static slave_argc]; */ /* struct client_string envp[static env_count]; */ } __attribute__((packed)); -_Static_assert(sizeof(struct client_data) == 10, "protocol struct size error"); +_Static_assert(sizeof(struct client_data) == 14, "protocol struct size error"); enum client_ipc_code { FOOT_IPC_SIGUSR, |
