Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Wed, 6 Apr 2005 09:39:05 -0700 (PDT) From: "Peter A. Castro" To: Luke Kendall cc: cygwin AT cygwin DOT com Subject: Re: zsh startup oddity In-Reply-To: <20050404065813.38B0084C39@pessard.research.canon.com.au> Message-ID: References: <20050404065813 DOT 38B0084C39 AT pessard DOT research DOT canon DOT com DOT au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-IsSubscribed: yes On Mon, 4 Apr 2005, Luke Kendall wrote: > On 1 Apr, Michael Wardle wrote: >> By what mechanism are you ensuring zsh is invoked as a login shell >> rather than a non-login shell? > > I think we were starting it via the cygwin shortcut (cygwin.bat), which > as you have said, just runs bash --login. IIRC, the way we were > starting zsh was via an exec inside the user's .profile. The trouble > was, the .profile was not being run if Cygwin's mkdir created the > /home mount point directory instead of Windows. > >> Does $- include "i"? >> Does setopt show that interactive is on? >> >> With Cygwin 1.5.13, zsh 4.2.4-1 and the simple shell invocation utility >> posted to this list on March 24 <4242381E DOT 2020008 AT endbracket DOT net> (which >> sets argv[0] to "-zsh"), zsh recognizes that it is a login shell and >> correctly sources .zprofile. > > Ah! Looks perfect! Thanks, Michael, we'll give that a try. > >> You've probably already checked these things, but I'd be surprised if >> this behavior was due to file permissions. > > We weren't surprised - we were flabbergasted! Anyway, we'll give your > excellent shell.c a try and see how that goes. > > Peter Castro replied to: > >>> But /etc/passwd would source $HOME/.zprofile if /home had been created >>> by Windows Explorer. >> >> I am unable to reproduce this. Are you using the zsh.bat file provided >> or a custom startup bat file or just running the shell by itself? Please >> make sure you are using the '-l' option to force a login shell. zsh has >> greatly changed in a years time. Please consider upgrading to a later >> release. > > No, we weren't using zsh.bat. Where does that get installed? I can't > find it, though I see I have zsh 4.2.4 installed from my very recent > complete re-install. Run 'mkzsh -A -D -P' from a bash shell and it will create zsh.bat in the root dir and create a desktop icon as well as a Cygwin menu item. It's a very simply bat file, like cygwin.bat itself. > I like the sound of Michael's shell.c because you don't need a separate > ..bat file to start up each different shell. I guess I don't understand how you are starting the shell, really. All you need to do is change cygwin.bat to run 'zsh -l -i' instead of 'bash --login' and it will run as a login shell. /zsh.bat is simply a convenient bat file which does this. It seems like overkill to run a cygwin shell wrapper which just does an exec of another shell, but to each their own. If it works for you, so much the better. > Thanks for the suggestions, > luke -- Peter A. Castro or "Cats are just autistic Dogs" -- Dr. Tony Attwood -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/