From owner-freebsd-questions@freebsd.org Wed Oct 12 02:56:29 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73ED0C0E1AF for ; Wed, 12 Oct 2016 02:56:29 +0000 (UTC) (envelope-from jkeen@verizon.net) Received: from vms173021pub.verizon.net (vms173021pub.verizon.net [206.46.173.21]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BA9764C for ; Wed, 12 Oct 2016 02:56:28 +0000 (UTC) (envelope-from jkeen@verizon.net) Received: from vz-proxy-l001.mx.aol.com ([64.236.82.153]) by vms173021.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0OEW00F2MW1I2H60@vms173021.mailsrvcs.net> for freebsd-questions@freebsd.org; Tue, 11 Oct 2016 20:56:06 -0500 (CDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.2 cv=VvtTO6+n c=1 sm=1 tr=0 a=FJ1kTJ0/xm5uTekQe8vMdQ==:117 a=IkcTkHD0fZMA:10 a=CH0kA5CcgfcA:10 a=ZZD23msA-22kjOhsxPIA:9 a=QEXdDO2ut3YA:10 Received: by 71.246.115.213 with SMTP id 2cddfe03; Wed, 12 Oct 2016 01:56:06 GMT To: freebsd-questions@freebsd.org From: James E Keenan Subject: $PS1 does not render command-line prompt in color in a FreeBSD VM Message-id: Date: Tue, 11 Oct 2016 21:56:05 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-version: 1.0 Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 02:56:29 -0000 This question concerns display of colors in the command-line prompt on two different FreeBSD installations. For a couple of months I have been using VirtualBox 5.1.2 to run FreeBSD-10.3 as a guest on an Ubuntu Linux 16.04 LTS host. When working in this VM I have been trying to avoid Linuxisms so as to better learn how to work in a BSD environment. One case: I'm using Bourne shell rather than Bash as the shell for my own user. In my .shrc file, I have this assignment for the spelling and color of my command-line prompt: PS1="[^[[31m\W^[[0m] \$ " ... where in each of two cases the '^[' is the ESCAPE character \033. This produces a prompt which I can verbally describe as: open-bracket in white; basename of pwd in red; close-bracket, space, dollar-sign, space in white ... 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. I should note that the VMWare console is perfectly capable of rendering different colors. Vim gets nice colors in syntax highlighting for both sh and perl. Does anyone have a clue as to why $PS1 DWIMs on FreeBSD-10.3 in VirtualBox while FreeBSD-11.0 does not in VMWare? Thank you very much. Jim Keenan