How does dired determine which ls program to use when running over tramp? I couldn't find it anywhere in the document. If it is insert-directory-program, what would it do if the path doesn't exist on the remote host?

  • 1
    Have you tested setting insert-directory-program to a value which doesn't exist on the remote host?
    – phils
    Oct 6, 2020 at 22:42
  • 1
    @phils I tested, doesn't seem to have any effects.
    – xuhdev
    Nov 22, 2020 at 9:08

1 Answer 1


Tramp does not use insert-directory-program. It has its own mechanism to detect a proper ls program.

Dired is not involved at all. It calls insert-directory, and let the local implementation, or the Tramp implementation run.

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.