From 7f902c4c03aecb125eec85e8e20e212eff5cae4c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 18 Oct 2018 08:12:10 +0530 Subject: [PATCH] Fix expansion of env vars not working in the :opt:`env` directive Fixes #1075 --- docs/changelog.rst | 4 ++++ kitty/config.py | 2 +- kitty/config_data.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 7b3293e63..705481d84 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -22,6 +22,10 @@ Changelog - macOS: Fix drag and drop of files not working on mojave (:iss:`1058`) + +- Fix expansion of env vars not working in the :opt:`env` directive + (:iss:`1075`) + 0.12.3 [2018-09-29] ------------------------------ diff --git a/kitty/config.py b/kitty/config.py index ff36fc0bc..ddcb9d4b5 100644 --- a/kitty/config.py +++ b/kitty/config.py @@ -337,7 +337,7 @@ def expandvars(val, env): result = m.group() return result - return re.sub(r'$\{(\S+)\}', sub, val) + return re.sub(r'\$\{(\S+?)\}', sub, val) @special_handler diff --git a/kitty/config_data.py b/kitty/config_data.py index 35ca4e1de..65b95778c 100644 --- a/kitty/config_data.py +++ b/kitty/config_data.py @@ -703,7 +703,7 @@ Specify environment variables to set in all child processes. Note that environment variables are expanded recursively, so if you use:: env MYVAR1=a - env MYVAR2=${MYVAR}/${HOME}/b + env MYVAR2=${MYVAR1}/${HOME}/b The value of MYVAR2 will be :code:`a//b`. '''))