Spawning new terminal with foot_exe from parent instance

Signed-off-by: Stéphane Klein <contact@stephane-klein.info>
This commit is contained in:
Stéphane Klein 2026-01-09 00:31:04 +01:00
parent b78cc92322
commit 55f743fe4e

10
main.c
View file

@ -624,8 +624,16 @@ main(int argc, char *const *argv)
if ((renderer = render_init(fdm, wayl)) == NULL)
goto out;
char foot_exe_path[PATH_MAX];
ssize_t len = readlink("/proc/self/exe", foot_exe_path, sizeof(foot_exe_path) - 1);
if (len == -1) {
fprintf(stderr, "error: /proc/self/exe: not exists\n");
return ret;
}
foot_exe_path[len] = '\0';
if (!as_server && (term = term_init(
&conf, fdm, reaper, wayl, "foot", cwd, token, pty_path,
&conf, fdm, reaper, wayl, foot_exe_path, cwd, token, pty_path,
argc, argv, NULL,
&term_shutdown_cb, &shutdown_ctx)) == NULL) {
goto out;