X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0	tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD,TW_TX
X-Spam-Check-By: sourceware.org
From: Kevin Layer <layer@franz.com>
To: cygwin@cygwin.com
Subject: Re: startxwin started bash does not read .bashrc or .bash_profile
In-reply-to: <512E489F.8060700@dronecode.org.uk>
References: <15470.1361923720@relay.known.net> <512E489F.8060700@dronecode.org.uk>
Comments: In-reply-to Jon TURNEY <jon.turney@dronecode.org.uk>   message dated "Wed, 27 Feb 2013 17:55:43 +0000."
Date: Wed, 27 Feb 2013 09:59:33 -0800
Message-ID: <6514.1361987973@freon.franz.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Jon TURNEY wrote:

>> On 27/02/2013 00:08, Kevin Layer wrote:
>> > If I put this into .startxwinrc:
>> > 
>> >   mintty /usr/bin/bash.exe --login -i
>> > 
>> > the resulting shell does not read .bash_profile.  If I put 
>> > 
>> >   mintty /usr/bin/bash.exe -i
>> > 
>> > it doesn't read .bashrc.
>> 
>> I've tried to reproduce this, but it seem to work ok for me.
>> 
>> How can are you checking if ~/.bashrc has been read? Have you tried using bash
>> -v to check what bash is reading?

I know ~/.bashrc hasn't been read because my prompt is not changed and
my aliases are not there.

>> This is also a really odd place to start mintty.  Why start it as a side
>> effect of the unrelated action starting the X server?

This is merely an example, the simplest one to reproduce the failure.
It's not how I want to use startxwin.

>> > My ultimate goal is to use ssh-agent/ssh-add to make life easier, but
>> > it requires my .bashrc to be sourced (.bash_profile merely sources
>> > .bashrc).
>> 
>> If you are going to work with both mintty and X clients, which will not
>> naturally have a common parent ssh-agent process to inherit from, you might
>> want to investigate the keychain package.

I'm unfamiliar with that.  Thanks for the pointer.

Kevin

--
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

