summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2015-02-13 07:17:17 -0800
committerRobby Russell <robby@planetargon.com>2015-02-13 07:17:17 -0800
commit5ee54032da9e5f9c5bd96dae877fbf6e08ad7af6 (patch)
tree8632b9161afac4947f58a38617e059c0e6427298
parentef7e53a78d0e4196c2d1e6e5b268209759d51753 (diff)
parent3704fbb71eb4d886aff11cdaff79a1a23a895cd6 (diff)
downloadzsh-5ee54032da9e5f9c5bd96dae877fbf6e08ad7af6.tar.gz
zsh-5ee54032da9e5f9c5bd96dae877fbf6e08ad7af6.tar.bz2
zsh-5ee54032da9e5f9c5bd96dae877fbf6e08ad7af6.zip
Merge pull request #3572 from mcornella/fix-apple_terminal-newtab-again
Extract CWD notifier back out of auto-title hooks
-rw-r--r--lib/termsupport.zsh20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index 58c6203a0..e1c2e2f93 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -31,13 +31,6 @@ function omz_termsupport_precmd {
fi
title $ZSH_THEME_TERM_TAB_TITLE_IDLE $ZSH_THEME_TERM_TITLE_IDLE
-
- # Notify Terminal.app of current directory using undocumented OSC sequence
- # found in OS X 10.9 and 10.10's /etc/bashrc
- if [[ $TERM_PROGRAM == Apple_Terminal ]] && [[ -z $INSIDE_EMACS ]]; then
- local PWD_URL="file://$HOSTNAME${PWD// /%20}"
- printf '\e]7;%s\a' "$PWD_URL"
- fi
}
# Runs before executing the command
@@ -58,3 +51,16 @@ function omz_termsupport_preexec {
precmd_functions+=(omz_termsupport_precmd)
preexec_functions+=(omz_termsupport_preexec)
+
+
+# Runs before showing the prompt, to update the current directory in Terminal.app
+function omz_termsupport_cwd {
+ # Notify Terminal.app of current directory using undocumented OSC sequence
+ # found in OS X 10.9 and 10.10's /etc/bashrc
+ if [[ $TERM_PROGRAM == Apple_Terminal ]] && [[ -z $INSIDE_EMACS ]]; then
+ local PWD_URL="file://$HOSTNAME${PWD// /%20}"
+ printf '\e]7;%s\a' "$PWD_URL"
+ fi
+}
+
+precmd_functions+=(omz_termsupport_cwd)