fix(enter): set PWD=<workdir> and stop forwarding the host PWD

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
This commit is contained in:
Luca Di Maio
2026-06-25 09:07:22 +02:00
parent 8f22547e2b
commit 348b79050f
3 changed files with 3 additions and 0 deletions
+1
View File
@@ -225,6 +225,7 @@ func FilterEnvVars() []string {
"HOME",
"PATH",
"PROFILEREAD",
"PWD", // host PWD is replaced by --env=PWD=<workdir>
"SHELL",
"XDG_SEAT",
"XDG_VTNR",
+1
View File
@@ -764,6 +764,7 @@ func (d *Docker) generateEnterCommand(
}
cmd = append(cmd, fmt.Sprintf("--workdir=%s", workdir))
cmd = append(cmd, fmt.Sprintf("--env=PWD=%s", workdir))
executablePath, err := os.Executable()
if err != nil {
+1
View File
@@ -847,6 +847,7 @@ func (p *Podman) generateEnterCommand(
}
cmd = append(cmd, fmt.Sprintf("--workdir=%s", workdir))
cmd = append(cmd, fmt.Sprintf("--env=PWD=%s", workdir))
executablePath, err := os.Executable()
if err != nil {