Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Oct 2016 16:49:41 -0400
From:      James E Keenan <jkeen@verizon.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: $PS1 does not render command-line prompt in color in a FreeBSD VM
Message-ID:  <f3f6e40e-285c-dfa6-2759-34e1a76fb8c4@verizon.net>
In-Reply-To: <20161012172419.GA18676@archlinux.localdomain>
References:  <d2b31340-dac9-fb6a-ba31-1ec8ac3707e2@verizon.net> <CADTH-otwNc8VX=NHxrJ6hAbe2H9k1uy7P127VTXALNsfctRJbA@mail.gmail.com> <208d3ae0-78ea-853f-6c48-6a74e1d61253@verizon.net> <20161012172419.GA18676@archlinux.localdomain>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/12/2016 01:24 PM, Dutch Ingraham wrote:
> On Wed, Oct 12, 2016 at 01:09:50PM -0400, James E Keenan wrote:
>> On 10/12/2016 12:16 PM, Roger Pate wrote:
>>> On Tue, Oct 11, 2016 at 9:56 PM, James E Keenan <jkeen@verizon.net> wrote:
>>>> This question concerns display of colors in the command-line prompt on two
>>>> different FreeBSD installations.
>>>
>>>> ... which in the terminal looks like:
>>>>
>>>> [jkeenan] $
>>>>
>>>> where 'jkeenan' is in red and all the rest is in white.  So far so good.
>>>>
>>>> Yesterday I installed FreeBSD-11 as a VM on the same Linux host -- only this
>>>> time I switched to using VMWare to house the VM.  I brought over my
>>>> .profile, .shrc, .vimrc, etc., files from the 10.3 VM to this new one. I
>>>> expected them to Just Work.  However the terminal inside the VMWare console
>>>> seems to be unable to digest the codes for color in the assignment to $PS1.
>>>> That value for $PS1 is rendering as:
>>>>
>>>> [[31mjkeenan[0m] $
>>>>
>>>> ... all rendered in white; nothing in red.  The control sequences to change
>>>> from white to red and back again are simply being literally displayed.
>>>
>>> How did you "bring over" your files from one VM to the other?  Did
>>> your escape characters get stripped?  If they did, that would explain
>>> what you see.
>>>
>>
>> The files were wrapped in a tarball and scp-ed.  The control characters in
>> the assignment to PS1 did not get stripped.  I examined them via 'od -c' on
>> each VM and the control character 033 is present where expected in both
>> cases.
>
> Just to confirm it has nothing to do with the transfer of the config files or
> the VM, I have a similar $PS1 scheme, also using sh as my shell, and have the
> same problem after upgrading from 10.3 to 11; this all on bare metal upgraded
> in-place, no file transfers needed.
>
> I haven't had time to debug yet, just wanted to get this out there to confirm
> this is not a local issue.

It clearly is a bug and has been reported here:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211360

I've entered a comment in that bug ticket to the effect that this is a 
regression with respect to user-friendliness.  If you share that 
opinion, please feel free to enter a comment there.

Thank you very much.
Jim Keenan




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f3f6e40e-285c-dfa6-2759-34e1a76fb8c4>