Currently, I can use C-x C-f to find-file (or ido-find-file) then open a dired directory and launch M-x shell. enter image description here

Is it possible to interactively navigate a path be it a local ~/Documents or tramp shell /ssh:server:Documents and immediately create shell instance on that directory similar to above workflow?

1 Answer 1


Here is a workflow for embark.

(defun open-shell-in-directory (directory &rest rest)
  (interactive "D")
  ;; If default-directory is a remote directory, make sure we find its
  ;; delete-directory handler.
  (setq directory (directory-file-name (expand-file-name directory)))
  (let ((default-directory directory))

and bind this function to embark-file-map with the key you like.

now you can navigate to some directory, embark-action and press the key you defined or just M-x open-shell-in-directory.

  • Do you if there is a map for ido-find-file similar to embark-file-map? If I am navigating with ido-find-file (without opening file or dired) and call embark-act I get Act on nil ''. Slowly reading docs if it's possible to do so.
    – phoxd
    Mar 15, 2022 at 18:19
  • Yes, I'm not sure if embark can be combined with ido. Just showing a workflow to see if you can learn from it. Mar 16, 2022 at 1:17

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.