Bash here

11 PM March 29, 2005

Cygwin is a blessing for all us unix-backgrounded developers hacking out a living on Windows boxen. Last night I came across a new Cygwin package, chere, a tool for adding shell prompt options to the Explorer right-click menu.

It is possible to do it yourself by mucking around in Explorer's File Types options page, but why bother when you can use one chere command instead?

    chere -ian2 -s bash

The downside is that you will have to be careful who uses your computer afterwards - the created menu item says "Bash here".

By alang | # | Comments (1)
(Posted to Software Development)


At 20:57, 24 May 2005 DouglasDD wrote:

I've been using a home-brewed version of this for several years now:

1) Install the MS Windows "Command Prompt Here" PowerToy:
(it's the microsoft-approved way to get a new DOS shell by right clicking anything in the Windows Explorer.)

2) UnZip UnxUtils, and add its 'wbin' dir to your %PATH%
(all that's *really* required for this hack is pwd.exe)

3) modify C:\cygwin\cygwin.bat:

    @echo off
    pushd .
    PWD > "%HOME%\cyg.dir"
    chdir C:\cygwin\bin
    bash --login -i

4) Ensure C:\cygwin is on your %PATH%

5) set %HOME% in your Windows environment

6) Add the following to the VERY END of your $HOME/.bashrc:

    if [ -f "$HOME/cyg.dir" ] ; then
      cwd_win=$( cat $HOME/cyg.dir | ~/ds/bin/
      cd "$( cygpath -u "$cwd_win" )"
      rm -f "$HOME/cyg.dir"

Over the years I've tuned it to work evn if $HOME is something with spaces (like %USERPROFILE%), but I much prefer setting HOME=c:\ddd for ease of typing and less paths-with-spaces-hell.


Add Comment

(Not displayed)

(Leave blank line between paragraphs. URLs converted to links. HTML stripped. Indented source code will be formatted with <pre> tags.)

© 2003-2006 Alan Green