This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Proposed change to base-files /etc/bash.bashrc: see whether PS1 has already been set


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:
> 
> /etc/bash.bashrc
> 
> ... 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?/etc/profile.d?directory, 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:
> 
> if [ -z "$PS1" ]; then
> ? ? ? ? PS1='\[\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.

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

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]