From 335b6af30100fd885a1a55d39925504bf6385a1e Mon Sep 17 00:00:00 2001 From: Matthieu Rakotojaona Date: Tue, 5 Mar 2024 14:47:05 +0100 Subject: [PATCH] Watch: allow changing directory --- acme/Watch/main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/acme/Watch/main.go b/acme/Watch/main.go index c61c616..7925f1d 100644 --- a/acme/Watch/main.go +++ b/acme/Watch/main.go @@ -259,6 +259,16 @@ func runBackground(id int) { } cmd := exec.Command(rc, "-c", string(line)) + windows, err := acme.Windows() + if err == nil { + // TODO at least log it + for _, w := range windows { + if win.ID() == w.ID { + cmd.Dir = path.Dir(w.Name) + break + } + } + } r, w, err := os.Pipe() if err != nil { log.Fatal(err)