company-mode is awesome. It even works in Eshell. However, when I'm cdd into another host, company mode makes Eshell unusable because it's always hanigng waiting for TRAMP.

Is there any way I can enable company-mode in Eshell, but only when the current directory is local?


1 Answer 1


The nuclear option worked for me after this behavior finally drove me around the bend while typing tramp filenames.

  ;; disable company completion of *all* remote filenames, whether   
  ;; connected or not
  (defun company-files--connected-p (file)
    (not (file-remote-p file)))
  • Do you know of any side-effects of using this?
    – PythonNut
    Jan 13, 2016 at 17:38
  • No; all's well so far... It seems that the worst case would be messed-up company completion of filenames. Maybe there's a way to disable that bit of company.
    – Bill White
    Jan 13, 2016 at 18:57
  • Hm... company still completes things like command names for me, and that is actually the more annoying lag. (I don't always type file paths, but I always type commands)
    – PythonNut
    Jan 29, 2016 at 16:50

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.