From 4fa4a20b22e6182d44ec5f5a7660e134c437c115 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 11 May 2019 12:57:25 +0530 Subject: [PATCH] When launching child process set the PWD environment variable This allows shells to display the symlink path to a directory instead of the resolved path, when the specified directory is a symlink. Fixes #1595 --- docs/changelog.rst | 3 +++ kitty/child.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index f4a1ccd96..6868d231f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -129,6 +129,9 @@ To update |kitty|, :doc:`follow the instructions `. It can now increment font size and reset it. It also only acts on the active top-level window, by default (:iss:`1581`) +- When launching child processes set the :code:`PWD` environment variable + (:iss:`1595`) + 0.13.3 [2019-01-19] ------------------------------ diff --git a/kitty/child.py b/kitty/child.py index fc91bd1bc..50a4ac460 100644 --- a/kitty/child.py +++ b/kitty/child.py @@ -168,6 +168,8 @@ class Child: env.update(self.env) env['TERM'] = self.opts.term env['COLORTERM'] = 'truecolor' + if self.cwd: + env['PWD'] = self.cwd if os.path.isdir(terminfo_dir): env['TERMINFO'] = terminfo_dir env = tuple('{}={}'.format(k, v) for k, v in env.items())