How to create a shortcut in the Windows 7 taskbar that starts mintty and cygwin?

4

4

I would like to have a starter in the Windows 7 taskbar that starts Cygwin, then starts mintty and then ideally navigates to /cygdrive/c/Users/myName/

I guess this should be possible using some unholy combination of batch files and shell scripts. Could you help me there?

bastibe

Posted 2010-08-31T13:51:08.673

Reputation: 3 544

Answers

8

You can just create a mintty shortcut, with these settings:

Target: C:\cygwin\bin\mintty /bin/env CHERE_INVOKING=1 /bin/bash -l
Start in: C:\Users\yourName

No scripts required. Setting CHERE_INVOKING stops /etc/profile from changing directory to $HOME. (That variable comes from the 'chere' package.)

ak2

Posted 2010-08-31T13:51:08.673

Reputation: 3 387

It might be worth noting that you mintty can be found in /cygwin/bin. – Mike H-R – 2014-10-02T16:29:51.657

Good answer. Note, however, that this ignores the shell is defined in /etc/passwd for the current user. – Andreas Spindler – 2013-01-23T19:32:34.490

C:\cygwin64\bin\mintty /bin/env CHERE_INVOKING=1 /bin/bash -l – zzapper – 2014-04-30T14:54:24.137

0

Humm, I do not know what starting Cygwin is.

According to Cygwin FAQ (http://cygwin.com/faq/faq-nochunks.html#faq.setup.home), if you have %HOME% properly setup in Windows (IIRC, in W7 it defaults to \users\%USER_NAME%, UNIX $HOME is set to the same directory. And most shells start with cwd $HOME.

alex

Posted 2010-08-31T13:51:08.673

Reputation: 185

In my Cygwin installation, home is /home/myName/, while the Windows 7 home is /Users/myName. – bastibe – 2010-09-01T06:10:33.353