Remote control launch: Fix the --copy-env option not copying current environment variables

Fixes #6724
This commit is contained in:
Kovid Goyal
2023-10-16 22:32:51 +05:30
parent d2026574b8
commit ddb121b418
5 changed files with 63 additions and 11 deletions

26
tools/cmd/at/launch.go Normal file
View File

@@ -0,0 +1,26 @@
// License: GPLv3 Copyright: 2023, Kovid Goyal, <kovid at kovidgoyal.net>
package at
import (
"fmt"
"os"
)
var _ = fmt.Print
func copy_local_env(copy_env bool) []string {
if copy_env {
return os.Environ()
}
return nil
}
func copy_local_cwd(copy_cwd string) string {
if copy_cwd == "current" {
if c, e := os.Getwd(); e == nil {
copy_cwd = c
}
}
return copy_cwd
}