Emacs Tramp hangs on saving & opening a current buffer after suspend/resume
Asked Answered
N

1

6

While running Emacs (24.3.1) with Tramp (2.2.6-24.3) on Ubuntu 12.10 I'll have a bunch of remote files open through Tramp for example:

m-x find-file: /scp:[email protected]:~/file.txt

After a suspend/resume cycle on my laptop I'll go back into Emacs and start working in an open buffer. Once I save or it autosaves it freezes, and will show an "args out of range(000 - 000)"(this message is from memory, the zeros represent numbers it shows will edit this next time I get it) error and not save. Any subsequent attempts will just hang.

Also I cannot open any other files using the same protocol in find-file, as in the case above 'scp'.

Some workarounds I have found are to first delete ~/.emacs.d/tramp file, which works sometimes, and there are times that it wasn't there after multiple suspend/resume cycles.

Another workaround is to use another protocol when opening files, so in the find-file line above I would use 'ssh' or 'scpc'. This is for only opening new buffers, not for saving current buffers, so I would usually close the file's buffer then reopen it using the different protocol I mentioned.

Any suggestions?

Nitro answered 10/5, 2014 at 14:44 Comment(0)
K
5

I haven't seen the "args out of range" error, but when I've had hangs after an interrupted connection I've been successful by killing the Tramp buffer for the protocol/host. It's generally named something like *tramp/scpc hostname*. The next operation on the file buffer that requires communication reestablishes the connection.

This is really easy with ido-switch-buffer because you can do it all in the mini-buffer - type a few letters to find the Tramp buffer and C-k to kill it.


An alternative (and perhaps cleaner) way to reset a connection is to use "M-x tramp-cleanup-this-connection":

tramp-cleanup-this-connection is an interactive autoloaded compiled Lisp function in `tramp-cmds.el'.

(tramp-cleanup-this-connection)

Flush all connection related objects of the current buffer's connection.

Also see "M-x tramp-cleanup-all-connections" and "M-x tramp-cleanup-all-buffers".

Kimberliekimberlin answered 12/5, 2014 at 0:32 Comment(1)
Just had a chance to try this and it worked. Also I noticed after it worked I did another suspend/resume cycle and it worked without hanging...so unless anyone else has a permanent fix this works for me. Thanks @rhashimoto.Nitro

© 2022 - 2024 — McMap. All rights reserved.