delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/03/26/15:23:13

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW
X-Spam-Check-By: sourceware.org
Date: Mon, 26 Mar 2012 21:22:47 +0200
From: David Sastre Medina <d DOT sastre DOT medina AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Proposed change to base-files /etc/bash.bashrc: see whether PS1 has already been set
Message-ID: <20120326192245.GA4183@pris.crapsteak.org>
References: <CAJ2Svn=behT0EJw2akH6E8DKPx38WMehhEghexQoKRSsGUaHuA AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <CAJ2Svn=behT0EJw2akH6E8DKPx38WMehhEghexQoKRSsGUaHuA@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--gKMricLos+KVdGMg
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Mar 26, 2012 at 04:40:31PM +0100, David Caldwell wrote:
> I can't figure out where the CVS is for base-files, but I wanted to
> propose that the file:
>=20
> /etc/bash.bashrc
>=20
> ... be altered to test whether the PS1 variable has already been set
> before setting it to the default.
> I set mine in a file in the=A0/etc/profile.d=A0directory, but with the
> standard Cygwin installation, this value is overwritten unless I
> modify each user's local setup or alter the system-wide file.
> It would be harmless to ignore already-set values in this situation.
> I could obviously generate a patch as necessary if I knew where the
> repository was, but it's a one-liner, basically:
>=20
> if [ -z "$PS1" ]; then
> =A0 =A0 =A0 =A0 PS1=3D'\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m=
\]\n\$ '
> fi

There is no public repository for the package. That does not stop you
from generating a patch, though :)
You forgot to say which shell are you using, as they are/can be
differently set up WRT PS1.

If I wanted all my users to get a custom (read: different from the
default) PS1, I guess I'd use the skel files for that.

If you decide to use a custom /etc/profile.d/ script to do that job,
then you need to tweak system-wide /etc/profile as well, IMHO.

Also, the patch is indeed harmless, but, as you provide it, i needs to
be used once for each ifdef in the profile.

--=20
Primary key fingerprint: AD8F BDC0 5A2C FD5F A179  60E7 F79B AB04 5299 EC56

--gKMricLos+KVdGMg
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iF4EAREIAAYFAk9wwgEACgkQ95urBFKZ7FaG1wD7BLyMR0w3q63et7ybKl4MyFjI
Q7c7qnJdzEfEhqjka1wA/imgkbY7XtOGCc5Y6LCsieY2YBMSJA2dx4ub4+KiWGFu
=67Qw
-----END PGP SIGNATURE-----

--gKMricLos+KVdGMg--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019