I had a similar problem opening files with Emacs/TRAMP from my MacBook.
You can turn on TRAMP debugging in your ~/.emacs
file:
(setq tramp-verbose 10)
After inserting that, restart Emacs and attempt to open your file again. When TRAMP freezes up, try hitting C-G
and then switch buffer (C-x b
) to *debug tramp/ssh REMOTEHOST*
. Inspect that for possible problems.
In my case, Tramp was freezing with the status line:
Tramp: Inserting `ssh:REMOTEHOST:/path/to/FILE'...done
The Tramp debug log showed lines with:
WARNING: terminal is not fully functional
I tracked this down to having turned on paging in my Mercurial setup, and less
was warning that TERM=dumb
. This was easily fixed in my ~/.hgrc
:
[pager] pager = LESS='FSRX' less -d
Finally, just for fun, here's the TRAMP setup in my ~/.emacs
file, which contains some small adjustments to make things run faster:
;; Tramp (http://www.emacswiki.org/emacs/TrampMode) for remote files (setq tramp-default-method "ssh") ;; Backup (file~) disabled and auto-save (#file#) locally to prevent delays in editing remote files (add-to-list 'backup-directory-alist (cons tramp-file-name-regexp nil)) (setq tramp-auto-save-directory temporary-file-directory)