[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: xsrc/54851: .profile is not read by sh when using xdm or other login managers
The following reply was made to PR xsrc/54851; it has been noted by GNATS.
From: Robert Elz <kre%munnari.OZ.AU@localhost>
Subject: Re: xsrc/54851: .profile is not read by sh when using xdm or other login managers
Date: Sat, 11 Jan 2020 09:02:06 +0700
Date: Fri, 10 Jan 2020 22:15:00 +0000 (UTC)
| Result: ifconfig and ping not in PATH, no tab completion...
shells (all shells, not just /bin/sh) read .profile (or their equivalent)
only when started as a login shell.
Whatever starts the shell needs to make that happen, if the shell you're
getting is in an xterm, then starting the xterm with the -ls option
will cause it to start a login shell, rather than a normal one.
I don't use xdm, but I believe it uses a .xsession file to decide what
to start when you log in (or something like that), if you're starting
xterms and want them to contain login shells, then add the -ls option
to each xterm started.
Alternatively, if all you care about is the PATH setting, then simply
set PATH (and export it) in your .xsession.
If you want command line editing, the best place to enable that is
usually in your $ENV file, as that needs to be set for each shell
started, login shell or not, just do it only for interactive shells:
case "$-" in
set -V -o tabcomplete; # or whatever you want
and export ENV (from either .profile, or .xsession, or both).
There are many many different approaches to getting all this right,
as what is "right" depends heavily upon the preferences of the user
concerned. No "one size fits all" is going to work for everyone,
or for that matter, most likely more than a small subset of users.
Main Index |
Thread Index |