On Fri, Apr 10, 2015 at 07:51:01PM -0400, dan mclaughlin wrote:
> On Fri, 10 Apr 2015 18:49:02 -0300 Henrique Lengler <henriquel...@opmbx.org> 
> wrote:
> > On Fri, Apr 10, 2015 at 12:22:45AM -0400, dan mclaughlin wrote:
> > > On Thu, 9 Apr 2015 16:58:29 -0300 Henrique Lengler 
> > > <henriquel...@opmbx.org> wrote:
> > > > On Sun, Apr 05, 2015 at 09:22:03PM -0700, Philip Guenther wrote:
> > > > > On Sun, Apr 5, 2015 at 9:12 PM, Andrew Fresh <and...@afresh1.com> 
> > > > > wrote:
> > > > > > On Sun, Apr 05, 2015 at 10:50:47PM -0300, Henrique Lengler wrote:
> > > > > >> And it is called in ~.profile with this:
> > > > > >> . /home/henri/.kshrc
> > > > > >>
> > > > > >> The problem is that these definitions work out of X, in the 
> > > > > >> console,
> > > > > >> logged as the same user (henri) but don't work under X.
> > > > > >> I open a xterm window and and type clr, I receive:
> > > > > >> /bin/ksh: clr: not found
> > > > > >> But out of X it works, can someone help me to make this thing work
> > > > > >> normally?
> > > > > >
> > > > > >
> > > > > > What I have done is set "ENV=$HOME/.kshrc" in .profile, then 
> > > > > > whenever you
> > > > > > open a new shell, it will use that file as a shell startup file.
> > > > > 
> > > > > That's step one, but whether it's enough depends on how you start X.
> > > > > 
> > > > > If you start X from the command line with 'startx' then yes, using
> > > > > export ENV=$HOME/.kshrc in your .profile should be enough, because
> > > > > your X clients will inherit that in the environment from startx.
> > > > > 
> > > > > If you start X with xdm, then you need to either
> > > > > A) manually set ENV (or source your entire .profile) from your
> > > > > .xsession that xdm invokes, OR
> > > > > B) tell xterm to start the shell inside it as a login shell, so that
> > > > > *that* will read your .profile.  This can be done by either:
> > > > >    B1) start xterm with the -ls option, or
> > > > >    B2) set "*loginShell: true" in your X resource database (c.f. 
> > > > > xrdb(1))
> > > > 
> > > > Still not able to do this. My /home/henri/.profile have this:
> > > > ------------------------------------------------------------
> > > > export ENV="$HOME/.kshrc"
> > > > export LC_CTYPE="en_US.UTF-8"
> > > > export GOPATH=$HOME/go
> > > > PATH=$PATH:$HOME/Scripts
> > > > 
> > > > My .kshrc
> > > > ---------
> > > > export PS1='$PWD $ '
> > > > alias quit=exit
> > > > alias clr=clear
> > > > alias logout=exit
> > > > alias bye=exit
> > > > alias j=jobs
> > > > 
> > > > 
> > > > BUT printenv says:
> > > > ------------------
> > > > /home/henri $ printenv
> > > > _=/usr/bin/printenv
> > > > XAUTHORITY=/home/henri/.Xauthority
> > > > LOGNAME=henri
> > > > WINDOWPATH=5
> > > > WINDOWID=6291457
> > > > HOME=/home/henri
> > > > LC_CTYPE=en_US.UTF-8
> > > > DISPLAY=:0
> > > > GOPATH=/home/henri/go
> > > > MAIL=/var/mail/henri
> > > > PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/home/henri/Scripts
> > > > SHELL=/bin/ksh
> > > > PS1=$PWD $
> > > > TERM=st-256color
> > > > USER=henri
> > > > 
> > > > Looks like it reads the PS1 env but not the rest, or they don't work.
> > > > Also I don't intend to use only xterm, but others term. emulators.
> > > 
> > > try adding some 'echo' statements in all of your startup scripts. ie
> > > 
> > >   echo "sourcing .profile"
> > >   echo "sourcing .kshrc"
> > > 
> > > to see if it is running them. then maybe add 'printenv' and 'alias' to 
> > > some
> > > to see what they print out during startup eg
> > > 
> > > alias clr
> > > alias clr=clear
> > > alias clr
> > > 
> > > the first should say 'not found', the one after should print your 
> > > definition.
> > 
> > It behave like this, when I log into ksh out of X.
> > This aliases are being applied correctly out of X, the problem is inside
> > it.
> 
> it really sounds like xterm is not starting a login shell. what is the output
> of:
> 
> $ ps | grep xterm
> 27150 p6  I       0:00.01 /bin/sh -c xterm -fg white -bg black -ls
> 13224 p6  I       0:05.29 xterm
>  6542 p6  I       0:01.18 xterm
> 29777 p6  I       0:00.00 /bin/sh -c xterm -fg white -bg black -ls
> 
> you should see an '-ls' option at the end as above. if not, that is your
> problem (it's not invoking a login shell), and this should work:

I know that xterm isn't being started with -ls option and it solve thw
problem.

But this couldn't be normal, is it? Because my intention is not to use
only xterm but also others term. emulators like st, and I would like to have
they working as it does in any other system.
If this is normal, will I need to configure and make sure that every
term. emulator I'm using is loading .profile.

> On Sun, Apr 05, 2015 at 09:22:03PM -0700, Philip Guenther wrote:
> > B) tell xterm to start the shell inside it as a login shell, so that
> > *that* will read your .profile.  This can be done by either:
> >    B1) start xterm with the -ls option, or
> >    B2) set "*loginShell: true" in your X resource database (c.f. xrdb(1))
> 
> also, xterm may be invoked elsewhere like in your ~/.xinitrc, so you would
> need to fix it there, but the xrdb option should take care of that.

-- 
Regards

Henrique Lengler 

Reply via email to