mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-08 05:34:00 -04:00
term_init(): initialize slave TERM from term_init() argument
This commit is contained in:
parent
69d62d3cd2
commit
0bd2ddd8ad
4 changed files with 6 additions and 6 deletions
2
main.c
2
main.c
|
|
@ -174,7 +174,7 @@ main(int argc, char *const *argv)
|
||||||
if ((wayl = wayl_init(fdm)) == NULL)
|
if ((wayl = wayl_init(fdm)) == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!as_server && (term = term_init(&conf, fdm, wayl, argc, argv,
|
if (!as_server && (term = term_init(&conf, fdm, wayl, conf.term, argc, argv,
|
||||||
&term_shutdown_cb, &shutdown_ctx)) == NULL)
|
&term_shutdown_cb, &shutdown_ctx)) == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
|
||||||
4
server.c
4
server.c
|
|
@ -117,8 +117,8 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
|
||||||
|
|
||||||
assert(client->term == NULL);
|
assert(client->term == NULL);
|
||||||
client->term = term_init(
|
client->term = term_init(
|
||||||
server->conf, server->fdm, server->wayl, client->argc, client->argv,
|
server->conf, server->fdm, server->wayl, server->conf->term,
|
||||||
&term_shutdown_handler, client);
|
client->argc, client->argv, &term_shutdown_handler, client);
|
||||||
|
|
||||||
if (client->term == NULL) {
|
if (client->term == NULL) {
|
||||||
LOG_ERR("failed to instantiate new terminal");
|
LOG_ERR("failed to instantiate new terminal");
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ initialize_fonts(struct terminal *term, const struct config *conf)
|
||||||
|
|
||||||
struct terminal *
|
struct terminal *
|
||||||
term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
||||||
int argc, char *const *argv,
|
const char *term_env, int argc, char *const *argv,
|
||||||
void (*shutdown_cb)(void *data, int exit_code), void *shutdown_data)
|
void (*shutdown_cb)(void *data, int exit_code), void *shutdown_data)
|
||||||
{
|
{
|
||||||
int ptmx = -1;
|
int ptmx = -1;
|
||||||
|
|
@ -428,7 +428,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
||||||
LOG_INFO("cell width=%d, height=%d", term->cell_width, term->cell_height);
|
LOG_INFO("cell width=%d, height=%d", term->cell_width, term->cell_height);
|
||||||
|
|
||||||
/* Start the slave/client */
|
/* Start the slave/client */
|
||||||
if ((term->slave = slave_spawn(term->ptmx, argc, argv, conf->term, conf->shell)) == -1)
|
if ((term->slave = slave_spawn(term->ptmx, argc, argv, term_env, conf->shell)) == -1)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
/* Initiailze the Wayland window backend */
|
/* Initiailze the Wayland window backend */
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,7 @@ struct terminal {
|
||||||
struct config;
|
struct config;
|
||||||
struct terminal *term_init(
|
struct terminal *term_init(
|
||||||
const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
||||||
int argc, char *const *argv,
|
const char *term_env, int argc, char *const *argv,
|
||||||
void (*shutdown_cb)(void *data, int exit_code), void *shutdown_data);
|
void (*shutdown_cb)(void *data, int exit_code), void *shutdown_data);
|
||||||
|
|
||||||
bool term_shutdown(struct terminal *term);
|
bool term_shutdown(struct terminal *term);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue