From mboxrd@z Thu Jan 1 00:00:00 1970 From: zimoun Subject: guix environment and .bashrc Date: Thu, 3 Jan 2019 23:53:05 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000287bc5057e95a09d" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfBrQ-0003jz-8D for help-guix@gnu.org; Thu, 03 Jan 2019 17:53:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfBrP-00031H-6f for help-guix@gnu.org; Thu, 03 Jan 2019 17:53:08 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:37389) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gfBrO-00030D-VT for help-guix@gnu.org; Thu, 03 Jan 2019 17:53:07 -0500 Received: by mail-wr1-x436.google.com with SMTP id s12so35025262wrt.4 for ; Thu, 03 Jan 2019 14:53:06 -0800 (PST) In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Cc: help-guix --000000000000287bc5057e95a09d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear G=C3=A1bor, Thank you for your comments. > What I did was to set up things in .xsessionrc. There is a drawback, though, and > it is that this startup file uses /bin/sh, which is most probably > dash, so I had to > adjust the recommendation of sourcing the profile. I also got some indications > that the generated file I sourced might assume that the used shell is bash. Yes, Debian uses dash as /bin/sh since a couple of release, I guess. > > The way that I use is to add an `else' clause to the $GUIX_ENVIRONMENT test: > > > > if [ -n "$GUIX_ENVIRONMENT" ] > > then > > export PS1=3D"\u@\h \w [dev]\$ " > > else > > source ~/.bash_profile > > fi > > > > Is it correct and the right way to do? > > If yes, does the manual need improvement in this section (footnote)? > > > > I believe it should be improved. There might also be some other distro specific > chevats. There was also a discussion about reducing bashism in the generated > files, but I don't remember if a conclusion was reached. >From my point of view the topic is about the interactive shell that it is used and the fix should not depend so much on the host distro. I imagine. :-) Maybe I do not understand a point, but the trick explained in the footnote of the manual is not accurate. Or I am wrong and I am asking more explanations. :-) Well, in X session, when an user opens a terminal, the shell is more often a non-login interactive shell than a login interactive shell if it is. Therefore, the file .bash_profile or .profile are not sourced when a terminal is open on X session. >From my point of view, the simplest fix is at the shell configuration level, I guess. For bash, source a file containing all the exports when not in $GUIX_ENVIRONMENT or something in the spirit is enough, isn't it? For zsh or other, it depends on how the configuration is sourced; I do not know. What do you think? Or where is wrong? Thank you in advance for any comments. All the best, simon --000000000000287bc5057e95a09d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear G=C3=A1bor,

Thank you for your comments.

> What I did was to set up things in .xsessionrc. There is a drawback, t= hough, and
> it is that this startup file uses /bin/sh, which is most probably
> dash, so I had to
> adjust the recommendation of sourcing the profile. I also got some ind= ications
> that the generated file I sourced might assume that the used shell is = bash.

Yes, Debian uses dash as /bin/sh since a couple of release, I guess.


> > The way that I use is to add an `else' clause to the $GUIX_EN= VIRONMENT test:
> >
> > if [ -n "$GUIX_ENVIRONMENT" ]
> > then
> >=C2=A0 =C2=A0 =C2=A0export PS1=3D"\u@\h \w [dev]\$ "
> > else
> >=C2=A0 =C2=A0 source ~/.bash_profile
> > fi
> >
> > Is it correct and the right way to do?
> > If yes, does the manual need improvement in this section (footnot= e)?
> >
>
> I believe it should be improved. There might also be some other distro= specific
> chevats. There was also a discussion about reducing bashism in the gen= erated
> files, but I don't remember if a conclusion was reached.

>From my point of view the topic is about the interactive shell that it is u= sed and the fix should not depend so much on the host distro. I imagine. :-= )

Maybe I do not understand a point, but the trick explained in the footnote = of the manual is not accurate. Or I am wrong and I am asking more explanati= ons. :-)

Well, in X session, when an user opens a terminal, the shell is more often = a non-login interactive shell than a login interactive shell if it is.
Therefore, the file .bash_profile or .profile are not sourced when a termin= al is open on X session.
>From my point of view, the simplest fix is at the shell configuration level= , I guess.
For bash, source a file containing all the exports when not in $GUIX_ENVIRO= NMENT or something in the spirit is enough, isn't it?
For zsh or other, it depends on how the configuration is sourced; I do not = know.

What do you think?
Or where is wrong?


Thank you in advance for any comments.


All the best,
simon
--000000000000287bc5057e95a09d--