To make Cygwin commands available from bash
, regardless of how you run it, as well as from cmd
or any other shell, make sure your Path
environment variable has Cygwin's bin
directory added.
Go to Control Panel > System and Security > System
(standard hotkey Win+Pause
), then Advanced system settings > Environment variables
. For all users, edit the system Path
variable, just for your user - edit (create if it doesn't exist) the user Path
variable.
Assuming cygwin
is installed at C:\cygwin
(might be cygwin64 for 64-bit Cygwin), add C:\cygwin\bin
to the Path
. Be aware that if you use the system Path
variable, if you add Cygwin's bin
in the beginning, some Cygwin's command will shadow built-in ones (e.g. Cygwin's find
will be used instead of Windows' find
). I prefer to do so, but if you don't, add Cygwin's bin
at the end of your Path
.
Since most other answers also talk about ConEmu setup, I'll give my personal opinion as well.
I prefer to run a non-login shell. For example, in Linux you get a login shell when you log in at the text console or via ssh, and a non-login interactive shell when you open a terminal emulator (xterm, konsole, etc.).
My {Bash} task has /dir "%CD%"
task parameters to set the working directory to the current tab's working directory (e.g. if the bash task from Far). The command to start bash:
%ConEmuDrive%\cygwin\bin\bash.exe -new_console:C:"%ConEmuDrive%\cygwin\Cygwin.ico"
Notice --login -i
options are omitted, shell will start as a non-login interactive shell (since it has no non-option arguments and without the -c option, and it's stdin and stdout are connected to terminals, refer to INVOCATION section of bash's manpage for more explanation). It will read and execute commands from the user rcfile ~/.bashrc
(not /etc/profile
or ~/.bash_profile
as a login shell would, thus you don't need to set CHERE_INVOKING=1
which is only relevant with regards to /etc/profile
). So put your user aliases, shell options, extra environment variables etc. to ~/.bashrc, where they rightfully belong.