From owner-freebsd-questions Sun Jan 21 21:19:25 2001 Delivered-To: freebsd-questions@freebsd.org Received: from post.mail.nl.demon.net (post-10.mail.nl.demon.net [194.159.73.20]) by hub.freebsd.org (Postfix) with ESMTP id 15CFA37B698 for ; Sun, 21 Jan 2001 21:18:58 -0800 (PST) Received: from [212.238.77.116] (helo=gateway.raggedclown.net) by post.mail.nl.demon.net with smtp (Exim 3.14 #2) id 14KZNX-0002bH-00; Mon, 22 Jan 2001 05:18:56 +0000 Received: from buffy.raggedclown.net (btvs.demon.nl [192.168.1.2]) by gateway.raggedclown.net (Postfix) with ESMTP id 3E5E25DB0; Mon, 22 Jan 2001 06:17:39 +0100 (CET) Received: by buffy.raggedclown.net (Postfix on SuSE Linux 7.0 (i386), from userid 500) id 0872412C3D; Mon, 22 Jan 2001 05:37:59 +0100 (CET) Date: Mon, 22 Jan 2001 05:37:59 +0100 From: Cliff Sarginson To: Trevin Chow Cc: questions@FreeBSD.ORG Subject: Re: color prompts? Message-ID: <20010122053759.A1639@raggedclown.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from tmchow@sfu.ca on Sun, Jan 21, 2001 at 02:31:20PM -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, Jan 21, 2001 at 02:31:20PM -0800, Trevin Chow wrote: > I'm looking at making my own prompt for bash and > saw this color information on the web for one particular > prompt: > > local COLOR1="\[\033[0;36m\]" > local COLOR2="\[\033[1;36m\]" > local COLOR3="\[\033[1;30m\]" > local COLOR4="\[\033[0m\]" > > Where exactly is the color information? Is there > a good howto somewhere? > Here is something I have on my Linux system... Adjust to taste ... # Terminal codes for petty displays # # \033 ascii ESCape # \033[G move to column (linux console, xterm, not vt100) # \033[C move columns forward but only upto last column # \033[D move columns backward but only upto first column # \033[A move rows up # \033[B move rows down # \033[1m switch bold on # \033[31m switch red on # \033[32m switch green on # \033[33m switch yellow on # \033[m switch color/bold off # \017 exit alternate mode (xterm, vt100, linux console) # \033[10m exit alternate mode (linux console) # \015 carriage return (without newline) # esc=`echo -en "\033"` BOLD="${esc}[1m" RED="${esc}[31m" GREEN="${esc}[32m" YELLOW="${esc}[33m" NORMAL=`echo -en "${esc}[m\017"` 1,1 Top ...have fun Cliff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message