emacs_ansi_term_support for zsh shell

This commit is contained in:
Ivan Malison 2015-10-15 03:25:25 -07:00
parent 757a30e066
commit 93df81a6c9

View File

@ -33,3 +33,20 @@ function omz_termsupport_preexec {
autoload -U add-zsh-hook
add-zsh-hook precmd omz_termsupport_precmd
add-zsh-hook preexec omz_termsupport_preexec
function emacs_ansi_term_support {
echo -e "\033AnSiTu" "$LOGNAME" # $LOGNAME is more portable than using whoami.
echo -e "\033AnSiTc" "$(pwd)"
if [ $(uname) = "SunOS" ]; then
# The -f option does something else on SunOS and is not needed anyway.
hostname_options="";
else
hostname_options="-f";
fi
echo -e "\033AnSiTh" "$(hostname $hostname_options)" # Using the -f option can
# cause problems on some OSes.
}
if environment_variable_exists INSIDE_EMACS; then
add-zsh-hook precmd emacs_ansi_term_support
fi