summaryrefslogtreecommitdiff
path: root/plugins/shell-proxy
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2021-04-28 18:07:03 -0600
committerTuowen Zhao <ztuowen@gmail.com>2021-04-28 18:07:03 -0600
commitb21e3c4f28d0d55947285dcebf9f91b580384b09 (patch)
tree3c4e0d946709ecb180e95610f16a8ae88179fb46 /plugins/shell-proxy
parentb6baa00fd2d8e44b5abda20f95461942b615258c (diff)
parent63a7422d8dd5eb93c849df0ab9e679e6f333818a (diff)
downloadzsh-b21e3c4f28d0d55947285dcebf9f91b580384b09.tar.gz
zsh-b21e3c4f28d0d55947285dcebf9f91b580384b09.tar.bz2
zsh-b21e3c4f28d0d55947285dcebf9f91b580384b09.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/shell-proxy')
-rwxr-xr-xplugins/shell-proxy/proxy.py5
-rw-r--r--plugins/shell-proxy/shell-proxy.plugin.zsh2
2 files changed, 4 insertions, 3 deletions
diff --git a/plugins/shell-proxy/proxy.py b/plugins/shell-proxy/proxy.py
index d2e5361cb..97f4cf873 100755
--- a/plugins/shell-proxy/proxy.py
+++ b/plugins/shell-proxy/proxy.py
@@ -9,8 +9,9 @@ user_proxy = os.environ.get("CONFIG_PROXY", os.path.expandvars("$HOME/.config/pr
def get_http_proxy():
- if "DEFAULT_PROXY" in os.environ:
- return os.environ["DEFAULT_PROXY"]
+ default_proxy = os.environ.get("DEFAULT_PROXY")
+ if default_proxy:
+ return default_proxy
if os.path.isfile(user_proxy):
return check_output(user_proxy).decode("utf-8").strip()
raise Exception("Not found, Proxy configuration")
diff --git a/plugins/shell-proxy/shell-proxy.plugin.zsh b/plugins/shell-proxy/shell-proxy.plugin.zsh
index fd0e2fe79..315ade665 100644
--- a/plugins/shell-proxy/shell-proxy.plugin.zsh
+++ b/plugins/shell-proxy/shell-proxy.plugin.zsh
@@ -4,7 +4,7 @@
__PROXY__="${0:A:h}/proxy.py"
proxy() {
- source <("$__PROXY__" "$1")
+ source <(env "DEFAULT_PROXY=$DEFAULT_PROXY" "$__PROXY__" "$1")
}
_proxy() {