Skip to content

Commit

Permalink
eterm: Populate some magic eterm variables
Browse files Browse the repository at this point in the history
With these variables set Emacs will magically traverse the remote SSH
connections to open files using TRAMP.

This is explained here:

http://www.emacswiki.org/emacs/AnsiTermHints#toc5
  • Loading branch information
bradwright committed May 6, 2014
1 parent bff79fe commit 636f0ba
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions functions
Expand Up @@ -145,3 +145,11 @@ set_go_path() {
source_if_exists() {
[ -f $1 ] && source $1
}

function set-eterm-dir {
# Sets up some eterm variables so TRAMP works
# Adapted from: http://www.emacswiki.org/emacs/AnsiTermHints#toc5
echo -e "\033AnSiTu" "$LOGNAME"
echo -e "\033AnSiTc" "$(pwd)"
echo -e "\033AnSiTh" "$(hostname)"
}
6 changes: 6 additions & 0 deletions zshrc
Expand Up @@ -118,6 +118,12 @@ precmd() {
fi

set_title

# We only want eterm magic with the right terminal and on a remote
# connection
if [ "$TERM" = "eterm-color" ] && [[ -n "$SSH_CONNECTION" ]]; then
set-eterm-dir
fi
}

set_title() {
Expand Down

0 comments on commit 636f0ba

Please sign in to comment.