Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
What ConEmu version you are trying? Also, not all bash versions supports working directory. Git bash - can, as I remember. –  Maximus May 3 '13 at 20:39
    
I 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. –  TMB May 4 '13 at 5:44
    
ConEmu x64 120727c.x64 –  TMB May 4 '13 at 5:46
    
With "working directory" I mean one you specify with /dir switch. BTW, have you read this answer? superuser.com/a/482340/139371 –  Maximus May 4 '13 at 9:33

3 Answers 3

up vote 7 down vote accepted

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.

  1. Go to Settings... (Win + Alt + P)
  2. Navigate to your list of Tasks (Startup > Tasks)
  3. Click on the Reload... button.

You should now see {CygWin bash} as one of your options in the list of predefined tasks:

Screenshot of CygWin bash in ConEmu

PS -- If this method doesn't work, try resetting your ConEmu settings (click the Reset... button at the bottom of your Settings window).

share|improve this answer
    
And if Reloading and Resetting don't work, I guess we could enter the path, command, and options as shown in your screen shot. –  TMB Mar 29 at 2:16
    
%SystemDrive%\cygwin64\bin\sh.exe --login -i for me on 140304 on the Preview Channel. –  TMB Mar 29 at 2:22
1  
For me clicking the Add default tasks... button (right above the Reload button) did the trick... –  Hanan N. Jun 26 at 19:17

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.

share|improve this answer
    
This 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 deleted home and made a junction with mklink -J home C:\Users in cmd.exe –  TMB May 4 '13 at 5:43
3  
Glad 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! –  Aaron Miller May 4 '13 at 6:48

or instead of

C:\cygwin\bin\bash.exe

use

C:\cygwin\Cygwin.bat
share|improve this answer
    
I think that's indeed the simplest way. –  this.lau_ Dec 27 '13 at 16:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.