summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Janke <andrew@apjanke.net>2015-09-03 13:05:24 -0400
committerAndrew Janke <andrew@apjanke.net>2015-09-03 13:05:24 -0400
commit93b4a6c02eeafb875de5d9bcccd73bdcd8265f40 (patch)
tree7cc87fcd416bf71cee77f30bf2e60cf607671f43 /lib
parent689b5ab3c8c8bf30ee63cafb8401d7d95e41f359 (diff)
parent0532860c618aabc02d5dab34391b967e8e4c6272 (diff)
downloadzsh-93b4a6c02eeafb875de5d9bcccd73bdcd8265f40.tar.gz
zsh-93b4a6c02eeafb875de5d9bcccd73bdcd8265f40.tar.bz2
zsh-93b4a6c02eeafb875de5d9bcccd73bdcd8265f40.zip
Merge branch 'master' into osx-fix-tab-for-iterm
Conflicts: plugins/osx/osx.plugin.zsh
Diffstat (limited to 'lib')
-rw-r--r--lib/functions.zsh16
-rw-r--r--lib/termsupport.zsh9
2 files changed, 24 insertions, 1 deletions
diff --git a/lib/functions.zsh b/lib/functions.zsh
index 17f5f9cbf..0d632a268 100644
--- a/lib/functions.zsh
+++ b/lib/functions.zsh
@@ -15,6 +15,22 @@ function take() {
cd $1
}
+function open_command() {
+ local open_cmd
+
+ # define the open command
+ case "$OSTYPE" in
+ darwin*) open_cmd="open" ;;
+ cygwin*) open_cmd="cygstart" ;;
+ linux*) open_cmd="xdg-open" ;;
+ *) echo "Platform $OSTYPE not supported"
+ return 1
+ ;;
+ esac
+
+ nohup $open_cmd "$@" &>/dev/null
+}
+
#
# Get the value of an alias.
#
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh
index e1c2e2f93..babbaa957 100644
--- a/lib/termsupport.zsh
+++ b/lib/termsupport.zsh
@@ -7,6 +7,9 @@
# (In screen, only short_tab_title is used)
# Limited support for Apple Terminal (Terminal can't set window and tab separately)
function title {
+ emulate -L zsh
+ setopt prompt_subst
+
[[ "$EMACS" == *term* ]] && return
# if $2 is unset use $1 as default
@@ -23,6 +26,10 @@ function title {
ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD
ZSH_THEME_TERM_TITLE_IDLE="%n@%m: %~"
+# Avoid duplication of directory in terminals with independent dir display
+if [[ $TERM_PROGRAM == Apple_Terminal ]]; then
+ ZSH_THEME_TERM_TITLE_IDLE="%n@%m"
+fi
# Runs before showing the prompt
function omz_termsupport_precmd {
@@ -43,7 +50,7 @@ function omz_termsupport_preexec {
setopt extended_glob
# cmd name only, or if this is sudo or ssh, the next cmd
- local CMD=${1[(wr)^(*=*|sudo|ssh|rake|-*)]:gs/%/%%}
+ local CMD=${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}
local LINE="${2:gs/%/%%}"
title '$CMD' '%100>...>$LINE%<<'