all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: "Thompson, David" <dthompson2@worcester.edu>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH] environment: Set a default value for PS1.
Date: Wed, 30 Mar 2016 23:27:30 +0200	[thread overview]
Message-ID: <874mbnac71.fsf@gnu.org> (raw)
In-Reply-To: <CAJ=RwfYq49YW+-0c+CC2ObmzwUT5bJjRoQdAMbmy1LurmXfiFA@mail.gmail.com> (David Thompson's message of "Wed, 30 Mar 2016 09:32:54 -0400")

"Thompson, David" <dthompson2@worcester.edu> skribis:

> On Wed, Mar 30, 2016 at 9:28 AM, Cyril Roelandt <tipecaml@gmail.com> wrote:
>> On 03/28/2016 03:22 AM, David Thompson wrote:
>>> +            ;; Set a reasonable default PS1.
>>> +            (setenv "PS1" "[ENV] \\u@\\h \\w\\$ ")
>>> +
>> Would it be an acceptable feature to let the user ask for their own PS1?
>> I very often have to make sure my code works on both Python 2.7 and
>> Python 3.4, and it would be very helpful to have environments named
>> "(py27)" and "(py34)" instead of just "[ENV]".
>
> I should have made the commit message better.  This change only
> applies to containers.  If you want to set your own PS1 there, source
> a script in the container.

Specifically, you can have something like this in ~/.bashrc (this is the
default on GuixSD):

--8<---------------cut here---------------start------------->8---
# Adjust the prompt depending on whether we're in 'guix environment'.
if [ -n "$GUIX_ENVIRONMENT" ]
then
    export PS1='\u@\h \w [env]\$ '
else
    export PS1='\u@\h \w\$ '
fi
--8<---------------cut here---------------end--------------->8---

HTH!

Ludo’.

      reply	other threads:[~2016-03-30 21:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-28  1:22 [PATCH] environment: Set a default value for PS1 David Thompson
2016-03-28 16:39 ` Ludovic Courtès
2016-03-30 13:10   ` Thompson, David
2016-03-30 13:28 ` Cyril Roelandt
2016-03-30 13:32   ` Thompson, David
2016-03-30 21:27     ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874mbnac71.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=dthompson2@worcester.edu \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.