zsh startup oddity
Peter A. Castro
doctor@fruitbat.org
Wed Apr 6 16:57:00 GMT 2005
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.2020008@endbracket.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 <doctor@fruitbat.org> or <Peter.Castro@oracle.com>
"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/
More information about the Cygwin
mailing list