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

  • Home
  • SEARCH
  • 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 60937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:14:24+00:00 2026-05-10T18:14:24+00:00

I am running GNU Emacs on Windows so entering: M-x shell launches the Windows

  • 0

I am running GNU Emacs on Windows so entering:

M-x shell 

launches the Windows command-line DOS shell. However, I would like to instead be able to run the Cygwin Bash Shell (or any other non-Windows shell) from within Emacs. How can this be easily done?

  • 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. 2026-05-10T18:14:25+00:00Added an answer on May 10, 2026 at 6:14 pm

    shell-file-name is the variable that controls which shell Emacs uses when it wants to run a shell command.

    explicit-shell-file-name is the variable that controls which shell M-x shell starts up.

    Ken’s answer changes both of those, which you may or may not want.

    You can also have a function that starts a different shell by temporarily changing explicit-shell-file-name:

    (defun cygwin-shell ()   'Run cygwin bash in shell mode.'   (interactive)   (let ((explicit-shell-file-name 'C:/cygwin/bin/bash'))     (call-interactively 'shell))) 

    You will probably also want to pass the --login argument to bash, because you’re starting a new Cygwin session. You can do that by setting explicit-bash-args. (Note that M-x shell uses explicit-PROGRAM-args, where PROGRAM is the filename part of the shell’s pathname. This is why you should not include the .exe when setting the shell.

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

Sidebar

Ask A Question

Stats

  • Questions 81k
  • Answers 81k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I figured it out. I do something like this: //… May 11, 2026 at 4:31 pm
  • Editorial Team
    Editorial Team added an answer I have updated my code to the following, which has… May 11, 2026 at 4:31 pm
  • Editorial Team
    Editorial Team added an answer Using the WMI interface, you can programatically recycle the AppPool… May 11, 2026 at 4:31 pm

Related Questions

I am stuck with a fairly complex Python module that does not return useful
I'm running into a problem where it is possible to insert a row into
Ok first off, I am linking to boost_system and boost_filesystem. My compiler is a
My custom homebrew photography processing software, running on 64 bit Linux/GNU, writes out PNG

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.