From 182f8ddd1a00d9abcdcee5d7179ecabcdd126a0e Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Wed, 2 Jul 2025 17:37:30 -0700 Subject: [PATCH] Do not resolve the symbolic link for the initial working directory --- src/termio/Exec.zig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index b8f838cf9..598617a12 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -847,6 +847,15 @@ const Subprocess = struct { else null; + // Propagate the current working directory (CWD) to the shell, enabling + // the shell to display the current directory name rather than the + // resolved path for symbolic links. This is important and based + // on the same behavior in Konsole and Kitty (see the linked issues): + // https://bugs.kde.org/show_bug.cgi?id=242114 + // https://github.com/kovidgoyal/kitty/issues/1595 + // https://github.com/ghostty-org/ghostty/discussions/7769 + if (cwd) |pwd| try env.put("PWD", pwd); + // If we have a cgroup, then we copy that into our arena so the // memory remains valid when we start. const linux_cgroup: Command.LinuxCgroup = cgroup: {