From 55f743fe4e5f2c056524d1da71be9f2feafae63f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Klein?= Date: Fri, 9 Jan 2026 00:31:04 +0100 Subject: [PATCH] Spawning new terminal with foot_exe from parent instance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Klein --- main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 9db77d0c..3b10d084 100644 --- a/main.c +++ b/main.c @@ -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;