Created
February 4, 2012 19:19
-
-
Save mkhattab/1739578 to your computer and use it in GitHub Desktop.
Emacs Multi Term Shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Emacs ansi-term directory tracking | |
# track directory, username, and cwd for remote logons | |
if [ "$TERM" = "eterm-color" ]; then | |
function eterm-set-cwd { | |
$@ | |
echo -e "\033AnSiTc" $(pwd) | |
} | |
# set hostname, user, and cwd | |
function eterm-reset { | |
echo -e "\033AnSiTu" $(whoami) | |
echo -e "\033AnSiTc" $(pwd) | |
echo -e "\033AnSiTh" $(hostname) | |
} | |
for temp in cd pushd popd; do | |
alias $temp="eterm-set-cwd $temp" | |
done | |
# set hostname, user, and cwd now | |
eterm-reset | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks dude, this was a lifesaver.