jcjordyn140 / mintty

Automatically exported from code.google.com/p/mintty
GNU General Public License v3.0
0 stars 0 forks source link

Simple configuration option/parameter for changing starting directory #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'd like to be able to create shortcuts that start up bash via mintty but
in a different directory than home.  I've found a number of tutorials for
other Cygwin shells that purport to do this but it looks like I'm not able
to get things quite right.  Here are the tutorials I've found:
http://sylefeb.blogspot.com/2006/10/tools-adding-cygwin-to-explorer-context.html
http://dam.mellis.org/2004/06/open_cygwin_bash_shell_here/
http://www.reddit.com/r/linux/comments/7uvsp/ask_linuxreddit_what_are_some_featu
res_that_you/c07h0jz

From those, I've build up the following Windows shortcut "Target:" command:
C:\cygwin\bin\mintty.exe c:\cygwin\bin\bash.exe --login -i -c 'cd
/cygdrive/c/Users/karl/theFolderThatIdLikeToStartIn;bash' bash

However, that doesn't seem to come with the default "user@host pwd\n$ " prompt.

It would be super if a simple way to do this was added as a mintty
parameter.  That would also make it trivial to add a "MinTTY Bash Prompt
Here" Explorer Context Menu entry.

My apologies if this is just a case of me not knowing enough and missing
the obvious solution.  My bash skills are fairly rudimentary.

Original issue reported on code.google.com by karl.mic...@gmail.com on 3 Mar 2009 at 1:04

GoogleCodeExporter commented 9 years ago
I think the easiest way to create such a shortcut is to put the directory into 
the
"Start In" field of the shortcut. The only problem here is that if you invoke 
bash as
a login shell (e.g using "-" or "bash --login"), it will execute /etc/profile, 
which
contains a 'cd "${HOME}". So you might want to change that, or invoke it as a
non-login shell and create a .bashrc with all the settings you want. See the 
bash
manual for the full story on all the various startup files.

Have a look at the 'chere' package for adding an Explorer context menu entry 
for mintty.

Original comment by andy.koppe on 3 Mar 2009 at 2:39