This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: zsh startup oddity

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

-- Peter A. Castro <> or <> "Cats are just autistic Dogs" -- Dr. Tony Attwood

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]