From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25414 invoked from network); 5 Jan 2005 03:53:17 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 Jan 2005 03:53:17 -0000 Received: (qmail 3249 invoked from network); 5 Jan 2005 03:53:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Jan 2005 03:53:11 -0000 Received: (qmail 812 invoked by alias); 5 Jan 2005 03:52:21 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8333 Received: (qmail 796 invoked from network); 5 Jan 2005 03:52:19 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Jan 2005 03:52:19 -0000 Received: (qmail 1543 invoked from network); 5 Jan 2005 03:51:20 -0000 Received: from ip-66-80-49-27.dsl.lax.megapath.net (HELO bang2.bigasterisk.com) (66.80.49.27) by a.mx.sunsite.dk with SMTP; 5 Jan 2005 03:51:13 -0000 Received: from dot.bigasterisk.com (IDENT:501@[10.1.0.227]) by bang2.bigasterisk.com (8.12.11/8.12.11) with ESMTP id j053oUtq032633 for ; Tue, 4 Jan 2005 19:50:30 -0800 Message-Id: <200501050350.j053oUtq032633@bang2.bigasterisk.com> X-Mailer: exmh version 2.7.0 06/18/2004 with nmh-1.0.4 From: Drew Perttula To: zsh-users@sunsite.dk Subject: Re: can zsh set background color? In-Reply-To: Your message of "Tue, 04 Jan 2005 10:18:03 EST." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 04 Jan 2005 19:50:58 -0800 X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: * X-Spam-Status: No, hits=1.6 required=6.0 tests=NO_DNS_FOR_FROM autolearn=no version=2.63 X-Spam-Hits: 1.6 > Is there any way for zsh to set the background color of my terminal > program? > > I'm often logged into to 3 different computers (ssh), and it would be > handy to be able to quickly look for the color of one to know that it > was the one where I was connected to X > > TjL > Zsh 4.1.1 on Mac OS X > As has been discussed, you'll need a terminal program that accepts escape codes to change the background color. But if you find that, you might be interested in my solution, which is to hash the hostname and generate a color from the result. I get a probably-different background color every time I connect to a new host. My code is on http://zshwiki.org/WishList and repeated here: # tint the terminal for each host bgcolor=`hostname | md5sum | /usr/local/bin/python -c "c1=raw_input(); col=[int(c1[x:x+2],16) for x in 0,2,4]; print '#%02x%02x%02x'%tuple([40*x/max(col) for x in col])"` print "\x1b]49;$bgcolor\x07"