From fe17d3c113d0793d9dae2f0a2d8ff4bc4142b6b0 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 19 Nov 2014 15:51:20 +0000 Subject: users/19404: Login shells may not be interactive Update the FAQ to point this out after years of neglect. --- Etc/FAQ.yo | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'Etc/FAQ.yo') diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo index 08ea979ee..dcb2ec579 100644 --- a/Etc/FAQ.yo +++ b/Etc/FAQ.yo @@ -1017,19 +1017,26 @@ sect(In which startup file do I put...?) reason it is important for administrators to make sure tt(/etc/zshenv) is as brief as possible. - The order in which the four files are searched (none of them myem(need) - to exist) is the one just given. However, tt(.zprofile) and tt(.zlogin) - are only run when the shell is a login shell --- when you first login, - of course, and whenever you start zsh with the tt(-l) option. All - login shells are interactive. The order is the only difference - between those; you should decide whether you need things set before or - after tt(.zshrc). These files are a good place to set environment - variables (i.e. mytt(export) commands), since they are passed on to - all shells without you having to set them again, and also to check - that your terminal is set up properly (except that if you want to - change settings for terminal emulator windows like tt(xterm) you will - need to put those in tt(.zshrc), since usually you do not get a login - shell here). + The order in which the four files are searched (none of them + myem(need) to exist) is the one just given. However, tt(.zprofile) + and tt(.zlogin) are only run when the shell is a login shell --- when + you first login, of course, and whenever you start zsh with the tt(-l) + option. The order is the only difference between those; you should + decide whether you need things set before or after tt(.zshrc). These + files are a good place to set environment variables (i.e. mytt(export) + commands), since they are passed on to all shells without you having + to set them again, and also to check that your terminal is set up + properly (except that if you want to change settings for terminal + emulator windows like tt(xterm) you will need to put those in + tt(.zshrc), since usually you do not get a login shell here). + + Login shells are often interactive, but this is not necessarily the + case. It is the programme that starts the shell that decides if it is + to be a login shell, and it is not required that the shell be run + interactively. A possible example is a display manager that starts a + shell to initialise your environment before running the window manager + to create terminals: it might run this as a login shell but with no + terminal, so it is not interactive. The only file you can alter which is started with every zsh (unless you use the tt(-f) option) is tt(.zshenv), so this is a good place to \ -- cgit 1.4.1