mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-03 01:40:17 -05:00
Spawning new terminal with foot_exe from parent instance
Signed-off-by: Stéphane Klein <contact@stephane-klein.info>
This commit is contained in:
parent
b78cc92322
commit
55f743fe4e
1 changed files with 9 additions and 1 deletions
10
main.c
10
main.c
|
|
@ -624,8 +624,16 @@ main(int argc, char *const *argv)
|
||||||
if ((renderer = render_init(fdm, wayl)) == NULL)
|
if ((renderer = render_init(fdm, wayl)) == NULL)
|
||||||
goto out;
|
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(
|
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,
|
argc, argv, NULL,
|
||||||
&term_shutdown_cb, &shutdown_ctx)) == NULL) {
|
&term_shutdown_cb, &shutdown_ctx)) == NULL) {
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue