From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROQAk-0003I9-Iv for qemu-devel@nongnu.org; Thu, 10 Nov 2011 03:39:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROQAj-0004Y5-5D for qemu-devel@nongnu.org; Thu, 10 Nov 2011 03:39:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROQAi-0004XQ-OL for qemu-devel@nongnu.org; Thu, 10 Nov 2011 03:39:45 -0500 Message-ID: <4EBB8DA4.1080907@redhat.com> Date: Thu, 10 Nov 2011 09:39:00 +0100 From: Gerd Hoffmann MIME-Version: 1.0 References: <12F471C8-2CF3-4CD7-B417-C8CC898669E6@mit.edu> <20111108093225.GB32533@elte.hu> <20111108125609.GA14272@ghostprotocols.net> <4EB9315A.10806@redhat.com> <20111108143228.GC14272@ghostprotocols.net> <4EB94D08.3010207@redhat.com> <20111109085120.GD11473@elte.hu> <4EBA5881.7080409@redhat.com> <20111109115502.GA18207@ghostprotocols.net> <20111109192509.GA22581@psychosis.jim.sh> In-Reply-To: <20111109192509.GA22581@psychosis.jim.sh> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [F.A.Q.] the advantages of a shared tool/kernel Git repository, tools/perf/ and tools/kvm/ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jim Paris Cc: Pekka Enberg , Theodore Tso , Peter Zijlstra , "kvm@vger.kernel.org list" , qemu-devel Developers , Vince Weaver , "linux-kernel@vger.kernel.org List" , Arnaldo Carvalho de Melo , Blue Swirl , Alexander Graf , Avi Kivity , =?ISO-8859-1?Q?Am=E9rico_Wang?= , Ingo Molnar , Linus Torvalds , Thomas Gleixner Hi, >>> As far I know it is pretty much impossible to figure the >>> foreground/background colors of the terminal you are running on. You >> >> Glad to hear that, I thought I hadn't researched that much (I did). Hope >> somebody appears and tell us how it is done :-) > > In xterm, '\e]10;?\e\\' and '\e]11;?\e\\' will report the colors, e.g.: > > #!/bin/bash > read -s -r -d \\ -p `printf '\e]10;?\e\\'` -t 1 fg > [ $? -ne 0 ] && fg="no response" > echo "foreground: $fg" | cat -v > read -s -r -d \\ -p `printf '\e]11;?\e\\'` -t 1 bg > [ $? -ne 0 ] && bg="no response" > echo "background: $bg" | cat -v Works fine in xterm. Neither gnome-terminal (i.e. vte widget) nor konsole support this though. cheers, Gerd