From owner-freebsd-questions Mon May 13 16:38:29 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA07130 for questions-outgoing; Mon, 13 May 1996 16:38:29 -0700 (PDT) Received: from virginia.edu (mars.itc.Virginia.EDU [128.143.2.9]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id QAA07125 for ; Mon, 13 May 1996 16:38:19 -0700 (PDT) Received: from archive.cs.virginia.edu by mail.virginia.edu id aa07669; 13 May 96 19:38 EDT Received: from stretch.cs.Virginia.edu (atf3r@stretch-fo.cs.Virginia.EDU [128.143.136.14]) by archive.cs.Virginia.EDU (8.7.1/8.6.6) with SMTP id TAA27741; Mon, 13 May 1996 19:38:03 -0400 (EDT) Received: by stretch.cs.Virginia.edu (4.1/SMI-2.0) id AA05542; Mon, 13 May 96 19:38:01 EDT Date: Mon, 13 May 1996 19:38:01 -0400 (EDT) From: "Adrian T. Filipi-Martin" Reply-To: adrian@virginia.edu To: David Cc: "freyes@i-2000.com" , FreeBSD questions mailing list Subject: Re: colored prompts in BASH In-Reply-To: Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Mon, 13 May 1996, David wrote: > On Sun, 12 May 1996, Francisco Reyes wrote: > > > I tried posting this question in the comp.unix.shell, but my post > > failed so here it goes.. > > ---------------- > > At work there is one Linux computer and the bash shell there > > has color prompts for different types of files. I have FreeBSD > > at home and I would like to have colored prompts. > > > > I have searched in the Bash FAQ and did not find anything > > regarding colored prompts. I tried the man pages also. > > > > Is this a feature available to Linux only? > > I don't believe so. I'm almost positive what you are referring > to is the color-ls package, which has been ported to FreeBSD already. > It's available as a package on ftp.freebsd.org. colorls-2.1.tgz is the > actual filename, which can be retrieved from /pub/FreeBSD/packages/All. > > ..djw Take a look at the color_xterm port/package. While both FreeBSD and Linux do have different and distinct colorized "ls" packages, I believe they both hinge upon having color_xterm installed. The stock xterm is monochrome, as are vt100 terminals. At the console prompt you can probably also get color into your prompts by using syscons/pcvt specific escape codes or some such nonsense. FYI, here's an example of how to get "user@path" into both your prompt as well as your xterm title. Setting your colors should be analogous. Note: the '^[' and '^G' are control characters. To enter literals in vi prfix them with ^v or in emacs ^q. MyPrompt=": \h@\w ;" PS1="^[]0;${MyPrompt}^G${MyPrompt}" Caveat: If you are using an unreliable link or terminal emulator which occasionally drops characters, your screen can get into a funny state when the right characters are dropped. 'stty sane' should clear up the problem. cheers, Adrian adrian@virginia.edu ---->>>>| Support your local programmer, System Administrator --->>>| STOP Software Patent Abuses NOW! NVL, NIIMS and Telemedicine Labs -->>| For an application and information Member: League for Programming Freedom ->| see: http://www.lpf.org/