f0981d564a5f9705cb87c00d746ab73ce7f2ec33
- Author
- Andrew Janke <andrew@apjanke.net>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
termsupport: protect subshell with quotes
Diff
1diff --git a/lib/functions.zsh b/lib/functions.zsh
2index a25855953736c7777e49b7518b26f0148e421e23..8ef3420bb113b9416f0841d0dd8d05a03fb19ffe 100644
3--- a/lib/functions.zsh
4+++ b/lib/functions.zsh
5@@ -114,7 +114,7 @@ zmodload zsh/langinfo
6 # Returns nonzero if encoding failed.
7 #
8 # Usage:
9-# omz_urlencode [-r] [-m] <string>
10+# omz_urlencode [-r] [-m] [-P] <string>
11 #
12 # -r causes reserved characters (;/?:@&=+$,) to be escaped
13 #
14diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
15index 5f61fe8ef2d4e3cd34fe441dde04779f709f9fa7..4c5068e9b40484c9f68632b80fff4e241cc8d0a9 100644
16--- a/lib/termsupport.zsh
17+++ b/lib/termsupport.zsh
18@@ -74,7 +74,7 @@ if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
19 # the host name to disambiguate local vs. remote paths.
20
21 # Percent-encode the pathname.
22- local URL_PATH=$(omz_urlencode -P $PWD)
23+ local URL_PATH="$(omz_urlencode -P $PWD)"
24 [[ $? != 0 ]] && return 1
25 local PWD_URL="file://$HOST$URL_PATH"
26 # Undocumented Terminal.app-specific control sequence