2

When a Tramp session over SSH has been inactive for some time, it fails to wake up again and just hangs Emacs. How can I ensure that Tramp will either renew the connection, or time out before too long?

The hang is evident from the minibuffer message:

Decoding remote file ‘/ssh:foohost:/home/bignose/barfile.txt’ using ‘base64 -d -i >%s’

and an animated spinner, that spins endlessly for tens of minutes without result.

During this, Emacs is hung: it doesn't respond to any commands or keys, not even keyboard-quit (C-g).

This is Emacs version 25.2.

How can I convince Emacs that Tramp sessions should be re-established when they time out, instead of waiting forever?

bignose
  • 627
  • 3
  • 15
  • If Emacs is stuck, see tips in https://emacs.stackexchange.com/questions/506/debugging-a-frozen-emacs for recovering. It might not help you make Tramp work but it should at least give you an opportunity to save your files locally. – Gilles 'SO- stop being evil' Jul 17 '17 at 14:19

2 Answers2

1

After the tramp-cleanup-all-connections command, you can just continue and a new session will be established on any further tramp action.

user3414663
  • 235
  • 1
  • 8
0

Abort with C-g, then kill the tramp buffers :

Open the buffer list with C-x C-b, locate anything tramp and mark them for deletion (d) then execute (x) you can now use Tramp again.

yPhil
  • 963
  • 5
  • 22
  • “Abort with C-g […]” — as noted in the question, Emacs is unresponsive (including C-g) while it is waiting for the SSH command to run. – bignose Jul 17 '17 at 07:15