The recent changes to xinitrc to use "exec -l" instead of "exec" to start the user's session are problematic. In particular, it is reasonable for a user to assume, when writing his .login or .profile file, that it will be executed in a terminal, since how can you log in without a terminal? But the commands run in /etc/X11/xdm/Xsession are not, in fact, run in a terminal. This causes all kinds of grief from my .login file. Here's my ~/.xsession-errors file from just logging in: Enter SSH passphrase: Entering port-forwarding mode: P4PORT=1666, PID=21293 jik:~!1> cat ~/.xsession-errors Enter SSH passphrase: stty: impossible in this context are you disconnected or in a batch, at, or cron script?stty: ioctl(user): bad file number while executing "stty -echo" ("while" body line 4) invoked from within "while {1} { send_user "Enter SSH passphrase: " stty -echo set old_timeout $timeout set timeout -1 expect_user { -re "(.+..." (file "/home/jik/scripts/ssh-add-both" line 8) Could not open a connection to your authentication agent. Agent pid 21177 stderr is not a tty - where are you? stderr is not a tty - where are you? It's prompting me for my passphrase because my .login does that, which is quite reasonable because it's supposed to be running inside a tty. All of the stty you see are from an expect script which has the same problem. Basically, I'm not at all convinced this change is appropriate.
> how can you log in without a terminal? Well, the answer is "using xdm/gdm/kdm", basically ;-) An X session is a login session. Read the "INVOCATION" section in the bash man page - there are interactive shells and login shells. Login shells may or may not be interactive shells. So in your .profile you would do something like: if test -n "$PS1"; then echo "This is an interactive shell" ssh-add ## etc. fi But X session login shells could also be interactive I suppose, e.g. if you use startx instead of *dm. Actually my bash help probably isn't so useful - since you are using .login I assume you're using tcsh. Xsession has always run a bash as a login shell; we changed it to make tcsh, etc. consistent. So bash users will already be seeing the no-tty-login-shell behavior and have dealt with this... but tcsh users were not getting their session set up properly (/etc/csh.login did not affect the entire X session). Quickly scanning the tcsh man page I don't see how to check whether you have an interactive shell, but there must be a way to do that in tcsh. We definitely need a mention of this change in the release notes...