From 780d05ceb155f55b945aa0ca854e8ffcfe7d37dc Mon Sep 17 00:00:00 2001 From: eugenesvk Date: Thu, 22 Jul 2021 18:43:49 +0700 Subject: [PATCH] Fix: get PWD from xonsh shell env instead of the os env fixes #238 --- templates/xonsh.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/xonsh.txt b/templates/xonsh.txt index 0fb3148..1b04bd0 100644 --- a/templates/xonsh.txt +++ b/templates/xonsh.txt @@ -37,9 +37,9 @@ def __zoxide_pwd() -> str: {%- if resolve_symlinks %} pwd = os.getcwd() {%- else %} - pwd = os.getenv("PWD") + pwd = __xonsh__.env.get("PWD") if pwd is None: - raise Exception("$PWD not found in env") + raise Exception("$PWD not found in Xonsh env") {%- endif %} return pwd