[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] environment: Set a default value for PS1.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] environment: Set a default value for PS1. |
Date: |
Wed, 30 Mar 2016 23:27:30 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
"Thompson, David" <address@hidden> skribis:
> On Wed, Mar 30, 2016 at 9:28 AM, Cyril Roelandt <address@hidden> wrote:
>> On 03/28/2016 03:22 AM, David Thompson wrote:
>>> + ;; Set a reasonable default PS1.
>>> + (setenv "PS1" "[ENV] address@hidden \\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='address@hidden \w [env]\$ '
else
export PS1='address@hidden \w\$ '
fi
--8<---------------cut here---------------end--------------->8---
HTH!
Ludo’.