Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: zsh for win32 - installation of zshrc

ok, let me be as precise i can.

1.  zsh first checks for the existence of the ZDOTDIR variable. If that is
not set,
     it checks for HOME.
2. if neither is set it, it sets a HOME variable. 
  This is os-dependent, as outlined in the README.

Once this value (ZDOTDIR or HOME) is determined, the win32 version itself
does NOT 
have it's own search mechanisms for any .rc files.  It is only trying to
pick a good default SINGLE directory to look for startup files.

what that means is that after this point, the shell behaves as if it was
running on
a unix system with no global /etc directory or other locations to check for
startup files. So, you only have the user's $home to look at.

If this still does not make sense, i'm afraid you will have to hope for
someone more eloquent to explain it. 

> > > What is the "windows directory" on Windows95
> > > (ie how is this defined in a Windows setup)?
> > c:\windows by default. or whatever directory you installed win95.
> Does the zsh look explicitly into the directory "C:\WINDOWS" then?
> If not then how does it determine this value?
> What if I have installed both Windows95 and WindowsNT on my disk?
> Which directory gets checked first then?
> (This is not just a theoretical issue!)
If you installed in c:\win95 and c:\nt, then each is
your "windows directory" when you boot into the specific OS. 

Again, there is no "first" or "second" directory to be searched. It's either
your ZDOTDIR, or a HOME directory set by you or the shell. 

this WILL be different between the two OSes if you let the shell pick the
default place. In the case of a multiboot, you therefore need to set HOME
explicitly in at least one of the OSes, if you want a common startup file.
Or you can put dummy .zshrcs that all source a common one in each
default HOME.

thus, if you have win95 in c:\windows and nt4.0 in c:\nt40, put
a .zshrc with

source c:/zsh/.zshrc

in each c:\windows, and another similar one in 

c:\nt40\profiles\<your user name>

> > 2. If ZDOTDIR is not set, and HOME is not set,
> > then zsh sets home to the directories above.
> This statement in unclear.  Does the zsh set HOME,
> and if so, does it change its value to a list of dirs in turn,
> stopping at the first dir where it can find a zshrc?
why in god's name would the shell search your disk for a .zshrc ?
it assumes a HOME directory name and sees if you have .zshrc 
there. if not, it starts without one.

> On the contrary!  The OS determines the kind of setup I have to use.
> And its syntax determines how I can access the value of variables.
that's ludicrous.

> And from the non-description it is still not clear to me where I would
> have to
> set the variables HOMEDRIVE and HOMEPATH - therefore I do not know whether
> I
> should set them with the autoexec.bat and whether I would have to use the
> syntax of command.com; I hope this makes the problem more clear now.
If you had used nt for any length of time, you would know that these are set
the system. 
Also, the $ notation is used in the readme because it's familiar unix
syntax. obviously
if you are trying to create a SOMEVAR path variable from variables FOO and
you would use

%FOO%\%BAR% in a batch/cmd file
$FOO/$BAR in a  zsh/tcsh script.

> The README is very concise and not at all precise,
> the changelog was pretty useless (as I remember),
> and emailing you is what I keep doing as I hope
> that this will be faster than reading the source.  ;-)
It seems to me that you are trying to figure out how to use
zsh without actually using it on NT. please try it first and then
email me (directly at amold@xxxxxxxxxxxxx) with any
questions. There are dozens of people already using the
shell, and i've *never* had questions like this.

> Well, this is your chance to have your info compiled by me.
> But I wonder whether it wouldn't be easier to write it up
> yourself in pseudo source style, eg like this:
> 	WindowsNT-4.x:
> 	if $HOME
> 	then test $HOME/.zshrc
> 	elsif ZDOTDIR
> 	then test $ZDOTDIR/.zshrc
> 	else test $USERPROFILE\.zshrc
> I just need something like this.
when i have some more time, i will try to put that together.


Messages sorted by: Reverse Date, Date, Thread, Author