2014-11-14 02:42:30 -07:00
|
|
|
# This is necessary for tramp.
|
2014-11-18 03:50:59 -07:00
|
|
|
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
|
2021-08-02 00:27:54 -06:00
|
|
|
|
2021-08-02 05:18:07 -06:00
|
|
|
source_if_exists ~/.custom.sh
|
2015-08-16 01:09:01 -06:00
|
|
|
source_if_exists ~/.this-machine.sh
|
2021-08-02 00:27:54 -06:00
|
|
|
|
|
|
|
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
|
|
|
|
# XXX/TODO: This disables correct setting of the current directory
|
|
|
|
# when in an sshed shell when inside of emacs
|
|
|
|
# echo -e "\033AnSiTh" "$(hostname $hostname_options)" # Using the -f option can #
|
|
|
|
# cause problems on some OSes.
|
|
|
|
}
|
|
|
|
|
|
|
|
if environment_variable_exists INSIDE_EMACS; then
|
|
|
|
if [[ $INSIDE_EMACS == *"term"* ]]
|
|
|
|
then
|
|
|
|
add-zsh-hook precmd emacs_ansi_term_support
|
|
|
|
fi
|
|
|
|
fi
|