X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <1299EF3181B10F479D85C328013285240331C4C5@THEZE.intra.cea.fr> References: <1299EF3181B10F479D85C328013285240331C4C5 AT THEZE DOT intra DOT cea DOT fr> Date: Thu, 29 Jul 2010 22:24:09 +0100 Message-ID: Subject: Re: Window shortcut to launch a Mintty login bash on a given directory From: Andy Koppe To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 29 July 2010 08:49, JOHNER Jean 066030 wrote: > Putting the following command line in a Windows shortcut opens a login > bash in the /home/User_name directory (~): > > C:\cygwin\bin\mintty.exe -e bash --login > > Now I would like to do the same in the /home/User_name/foobar directory. I assume you don't want to change your home directory? You could do that by editing /etc/passwd. > I tried: > > C:\cygwin\bin\mintty.exe -e bash --login -c "cd foobar" > > with the result that the Mintty window vanishes. That's because you've told bash to execute just the command "cd foobar", after which it will exit. Note besides, the -e isn't needed (but won't do any harm), and you can use --hold=always (or -ha for short) to keep the mintty window open after the shell exits. > I also tried to add > > C:\cygwin\home\User_name\foobar > > in the "Start in" box of the windows shortcut. With no effect. That was the right idea. The reason it didn't work is that /etc/profile changes back to your home directory, unless the variable CHERE_INVOKING (used by the 'chere' package) is set. Hence you could get it to work by changing the shortcut target to this: C:\cygwin\bin\mintty.exe /bin/env CHERE_INVOKING=1 /bin/bash --login Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple