summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarc Cornellà <marc.cornella@live.com>2015-12-01 14:05:38 +0100
committerMarc Cornellà <marc.cornella@live.com>2015-12-01 14:05:38 +0100
commit4e306887c248f3887a8e163c993f31df5a62487e (patch)
treea91ed33b9cdb4063039e21a4b8ea93f1b16e0658 /lib
parenteca912e51ac379691e3d5904808271aba7de8e51 (diff)
downloadzsh-4e306887c248f3887a8e163c993f31df5a62487e.tar.gz
zsh-4e306887c248f3887a8e163c993f31df5a62487e.tar.bz2
zsh-4e306887c248f3887a8e163c993f31df5a62487e.zip
Cleanup update_terminalapp_cwd function
Diffstat (limited to 'lib')
-rw-r--r--lib/termsupport.zsh9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 6271725a2..7cf15b0a0 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -76,19 +76,18 @@ preexec_functions+=(omz_termsupport_preexec)
# With extra fixes to handle multibyte chars and non-UTF-8 locales
if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then
-
# Emits the control sequence to notify Terminal.app of the cwd
+ # Identifies the directory using a file: URI scheme, including
+ # the host name to disambiguate local vs. remote paths.
function update_terminalapp_cwd() {
emulate -L zsh
- # Identify the directory using a "file:" scheme URL, including
- # the host name to disambiguate local vs. remote paths.
# Percent-encode the pathname.
local URL_PATH="$(omz_urlencode -P $PWD)"
[[ $? != 0 ]] && return 1
- local PWD_URL="file://$HOST$URL_PATH"
+
# Undocumented Terminal.app-specific control sequence
- printf '\e]7;%s\a' $PWD_URL
+ printf '\e]7;%s\a' "file://$HOST$URL_PATH"
}
# Use a precmd hook instead of a chpwd hook to avoid contaminating output