Tramp hangs for several minutes every time I launch Emacs, giving me these errors:

Tramp: Opening connection for bin using scp...
Tramp: Sending command `exec ssh  -e none bin'
Tramp: Waiting for prompts from remote shell...
Timeout reached, see buffer `*tramp/scp bin*' for details
Tramp: Waiting for prompts from remote shell...failed
Tramp: Opening connection for bin using scp...failed

My tramp debug: https://gist.github.com/2dc7672fb5aa22f06b53

I believe it's related to this: https://github.com/emacs-helm/helm/issues/1000

and this: https://github.com/syl20bnr/spacemacs/issues/3422#issuecomment-148919047

I followed the directions from the Spacemacs FAQ, which suggests this solution:

(setq tramp-ssh-controlmaster-options "-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no")

This didn't have any effect.

I also tried this:

(setq tramp-ssh-controlmaster-options nil)

...but I got the same result.

The FAQ suggests that if the above doesn't work, you can try to put these settings directly in ~/.ssh/config:

Host *  
ControlMaster auto  
ControlPath ~/.ssh/master -%r@%h:%p  
ControlPersist = no `  

So I did this, which caused the error message to change to this:

Tramp failed to connect.
Garbage at the end of the line. -%r@%h:%p  
If this happens repeatedly, try M-x tramp-cleanup-this-connection

I did also try tramp-cleanup-this-connection also, but it too had no effect.

How can I get Emacs to stop hanging on startup?

1 Answer 1


The message Sending command 'exec ssh -e none bin' is a clue that an error is occurring when exec-path-from-shell reads the path from the shell environment.

Once I figured this out, I checked my .bashrc and found the offending line:

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

Killing this line solved the Emacs launch problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.