Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6821267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:31:29+00:00 2026-05-26T21:31:29+00:00

On Mac OS I can use the terminal, write cd , and then drag

  • 0

On Mac OS I can use the terminal, write “cd “, and then drag & drop folders from Finder to the terminal. I then obtain something like “cd /Users/…” which allows me to quickly change to the corresponding directory.
If I open an emacs shell with M-x shell and drag & drop a folder to it, emacs changes in dired mode and displays me the content of the folder I dropped. How can I “exit” or “quit” dired-mode and obtain a shell having directory changed to the folder I dropped? That would give me something like above and that would be quite useful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:31:30+00:00Added an answer on May 26, 2026 at 9:31 pm

    You can implement a function to open a shell instead of dired buffer. This function is useful in many other cases, not only in a case of DnD

    (require 'dired)
    (define-key dired-mode-map "c" 'shell-instead-dired)
    
    (defun shell-instead-dired ()
      (interactive)
      (let ((dired-buffer (current-buffer)))
        (shell (concat default-directory "-shell"))
        (kill-buffer dired-buffer) ;; remove this line if you don't want to kill the dired buffer
        (delete-other-windows)))
    

    EDIT In this case you need to DnD a directory in Emacs and press ‘c’ to call a shell in this directory.

    Otherwise you may install a smart-dnd package and configure it to open a shell. I provides also other useful stuff like creating <img ...> tags in html mode if you drop a jpg or #include<...> in c-mode if you drop a header.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I often use git from Terminal on Mac to download some repositories and then
in Linux and Mac OS X I can use stepi and nexti to debug
I don't use a mac much so my exposure is minimal but can I
In C++ I Can Read The MAC Address Of The NIC and Use It
How can I remove those annoying Mac OS X .DS_Store files from a Git
I'm looking for help with a one-liner that I can run from the Mac
i am receiving packets from a terminal device and then upon receiving packets on
I've installed the Ruby gem 'haml' on my mac, which I can use to
I use Terminal in Mac with the following command: df -lak | grep File||disk02
I don't know what has happened, but Terminal on Mac OSX 10.5 can no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.