diff --git a/acme/Watch/main.go b/acme/Watch/main.go index 3dab160..ede065c 100644 --- a/acme/Watch/main.go +++ b/acme/Watch/main.go @@ -259,7 +259,16 @@ func runBackground(id int, dir string) { } cmd := exec.Command(rc, "-c", string(line)) - cmd.Dir = dir + 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)