From 1c072856ebf12419378c5098ad543c497197c6da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 10 Sep 2022 12:04:39 +0200 Subject: [PATCH] input: pipe-*: set current CWD when spawning the sub-process Closes #1166 --- CHANGELOG.md | 4 ++++ input.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b54016de..793f6376 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,10 @@ * Default color theme from a variant of the Zenburn theme, to a variant of the Solarized dark theme. * Default `pad` from 2x2 to 0x0 (i.e. no padding at all). +* Current working directory (as set by OSC-7) is now passed to the + program executed by the `pipe-*` key bindings ([#1166][166]). + +[1166]: https://codeberg.org/dnkl/foot/issues/1166 ### Deprecated diff --git a/input.c b/input.c index 3aa8b004..0a3773bc 100644 --- a/input.c +++ b/input.c @@ -283,7 +283,7 @@ execute_binding(struct seat *seat, struct terminal *term, } } - if (!spawn(term->reaper, NULL, binding->aux->pipe.args, + if (!spawn(term->reaper, term->cwd, binding->aux->pipe.args, pipe_fd[0], stdout_fd, stderr_fd, NULL)) goto pipe_err;