How do I configure ConEmu to run Cygwin Bash?
Solution 1
This might helps others.
It looks like version 140310 of ConEmu automatically detects CygWin Bash.
If you've installed Cygwin after you installed ConEmu, you'll need to Reload... your list of Tasks.
- Go to Settings... (Win + Alt + P)
- Navigate to your list of Tasks (Startup > Tasks)
- Click on the Reload... button.
You should now see {CygWin bash} as one of your options in the list of predefined tasks:
PS -- If this method doesn't work, try resetting your ConEmu settings (click the Reset... button at the bottom of your Settings window).
Solution 2
or instead of
C:\cygwin\bin\bash.exe
use
C:\cygwin\Cygwin.bat
Solution 3
Ensure that Bash is receiving a sensible value for $PATH
; usually it inherits that from whatever calls it, but ConEmu is a Windows application, so all it's going to provide is whatever you have set for %Path%
. Generally that doesn't include the Cygwin path directories, so Bash doesn't know where to look for ls
, &c.
The way I'd solve this would be to, via whatever means ConEmu offers for doing so, pass --login -i
as command line arguments to Bash; this will tell it you're running it as an interactive login shell, so it will read /etc/profile
, ~/.profile
, and ~/.bashrc
on start. In my experience, that's been enough to give it a sensible $PATH
; if that doesn't work for you, you could specify it explicitly with a line like PATH=/bin:/usr/bin:/usr/local/bin:[...]:$PATH
in your ~/.bashrc
.
Solution 4
This is my way
Create a new task in ConEmu with following command
set HOME=C:\Home & "C:\Home\Applications\cygwin64\bin\mintty.exe" -i /Cygwin-Terminal.ico -
Related videos on Youtube
TMB
Updated on September 18, 2022Comments
-
TMB over 1 year
I created a new task
{Bash}
passed my home directory
/dir "C:\Users\TMB\"
and added bash as an application
C:\cygwin\bin\bash.exe
When I open Bash, it is unable to use the basic UNIX/Cygwin utilities. How do I configure ConEmu to run Cygwin Bash?
-
Maximus about 11 yearsWhat ConEmu version you are trying? Also, not all bash versions supports working directory. Git bash - can, as I remember.
-
TMB about 11 yearsI couldn't figure out how to set me working directory in my bash profile, but I think I found a more general solution below the marked answer.
-
Maximus about 11 yearsWith "working directory" I mean one you specify with /dir switch. BTW, have you read this answer? superuser.com/a/482340/139371
-
-
TMB about 11 yearsThis got me the utilities I was looking for next I wanted to point to my normal windows home directory not
/cygdrive/c/cygwin/home
so I deletedhome
and made a junction withmklink -J home C:\Users
in cmd.exe -
Aaron Miller about 11 yearsGlad it did the job for you. I never thought about using a junction to point ~ at c:\users\me, but I once did it with a symlink, and from that experience I give you the following warning: if you ever need to run ComboFix to clean up a malware infestation on your machine, it will blow away any files in c:\users\you. I lost everything in my home directory that way once, and my newest backup was a week old. Don't make the same mistake I did!
-
laurent over 10 yearsI think that's indeed the simplest way.
-
TMB about 10 yearsAnd if Reloading and Resetting don't work, I guess we could enter the path, command, and options as shown in your screen shot.
-
TMB about 10 years
%SystemDrive%\cygwin64\bin\sh.exe --login -i
for me on 140304 on the Preview Channel. -
Hanan N. almost 10 yearsFor me clicking the
Add default tasks...
button (right above theReload
button) did the trick... -
John Prior over 9 yearsNote that sh.exe won't source your .bashrc; only bash.exe will do that. So I'm using the command
%SystemDrive%\cygwin64\bin\bash.exe --login -i
-
flungo over 9 years@JohnPrior's comment is actually very helpful. The PATH variable was all wrong when using sh.exe, but with bash.exe it can now actually find my applications.
-
Dr. Koutheir Attouchi over 7 yearsYour solution works, and I like having the mintty.exe interface, but can you explain why this works? Especially, what is the "&" doing here?
-
carl.anderson over 7 yearsI found that if I wanted to have the default tab start bash, I had to select the
{Bash}
task on the Startup settings (one level above Tasks).