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 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

Related Questions

I am running GNU Emacs 23 on a Windows-machine and having problems getting ido-find-file
Running GNU Emacs 22.2.1 on Ubuntu 9.04. When editing python code in emacs, if
I'm running an application (firefox) and I would like to know if it's possible
I am running Gnu iconv from a .bat file in Windows Vista (Sorry about
When running a vim instance in gnu screen hitting shift enter in insert mode
I'm running Ubuntu 11.10 and GNU Screen version "4.00.03jw4", and I'm trying to use
My custom homebrew photography processing software, running on 64 bit Linux/GNU, writes out PNG
I am running GNU Screen in multiuser mode and have several users connected to
I am running some gnu time scripts which generates output of the form mm:ss.mm
I am running a little program in python that launches a small window that

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.