From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756707Ab1KIUOM (ORCPT ); Wed, 9 Nov 2011 15:14:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20114 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751580Ab1KIUOL (ORCPT ); Wed, 9 Nov 2011 15:14:11 -0500 Date: Wed, 9 Nov 2011 18:13:37 -0200 From: Arnaldo Carvalho de Melo To: Jim Paris Cc: Gerd Hoffmann , Ingo Molnar , Theodore Tso , Anthony Liguori , Pekka Enberg , Vince Weaver , Avi Kivity , "kvm@vger.kernel.org list" , "linux-kernel@vger.kernel.org List" , qemu-devel Developers , Alexander Graf , Blue Swirl , =?iso-8859-1?Q?Am=E9rico?= Wang , Linus Torvalds , Thomas Gleixner , Peter Zijlstra Subject: Re: [F.A.Q.] the advantages of a shared tool/kernel Git repository, tools/perf/ and tools/kvm/ Message-ID: <20111109201337.GH18207@ghostprotocols.net> References: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111109192509.GA22581@psychosis.jim.sh> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Nov 09, 2011 at 02:25:09PM -0500, Jim Paris escreveu: > Arnaldo Carvalho de Melo wrote: > > Em Wed, Nov 09, 2011 at 11:40:01AM +0100, Gerd Hoffmann escreveu: > > > 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 gnome-terminal: [acme@felicio ~]$ ./a.sh foreground: no response background: no response [acme@felicio ~]$ :-( - Arnaldo From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaldo Carvalho de Melo Subject: Re: [F.A.Q.] the advantages of a shared tool/kernel Git repository, tools/perf/ and tools/kvm/ Date: Wed, 9 Nov 2011 18:13:37 -0200 Message-ID: <20111109201337.GH18207@ghostprotocols.net> References: <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alexander Graf , Theodore Tso , Peter Zijlstra , "kvm@vger.kernel.org list" , qemu-devel Developers , Vince Weaver , "linux-kernel@vger.kernel.org List" , Pekka Enberg , Blue Swirl , Gerd Hoffmann , =?iso-8859-1?Q?Am=E9rico?= Wang , Ingo Molnar , Linus Torvalds , Thomas Gleixner , Avi Kivity To: Jim Paris Return-path: Content-Disposition: inline In-Reply-To: <20111109192509.GA22581@psychosis.jim.sh> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org Em Wed, Nov 09, 2011 at 02:25:09PM -0500, Jim Paris escreveu: > Arnaldo Carvalho de Melo wrote: > > Em Wed, Nov 09, 2011 at 11:40:01AM +0100, Gerd Hoffmann escreveu: > > > 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 gnome-terminal: [acme@felicio ~]$ ./a.sh foreground: no response background: no response [acme@felicio ~]$ :-( - Arnaldo From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROEXC-0001hW-LE for qemu-devel@nongnu.org; Wed, 09 Nov 2011 15:14:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROEXB-0006f8-56 for qemu-devel@nongnu.org; Wed, 09 Nov 2011 15:14:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROEXA-0006eg-TF for qemu-devel@nongnu.org; Wed, 09 Nov 2011 15:14:09 -0500 Date: Wed, 9 Nov 2011 18:13:37 -0200 From: Arnaldo Carvalho de Melo Message-ID: <20111109201337.GH18207@ghostprotocols.net> References: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111109192509.GA22581@psychosis.jim.sh> 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: Alexander Graf , Theodore Tso , Peter Zijlstra , "kvm@vger.kernel.org list" , qemu-devel Developers , Vince Weaver , "linux-kernel@vger.kernel.org List" , Pekka Enberg , Blue Swirl , Gerd Hoffmann , =?iso-8859-1?Q?Am=E9rico?= Wang , Ingo Molnar , Linus Torvalds , Thomas Gleixner , Avi Kivity Em Wed, Nov 09, 2011 at 02:25:09PM -0500, Jim Paris escreveu: > Arnaldo Carvalho de Melo wrote: > > Em Wed, Nov 09, 2011 at 11:40:01AM +0100, Gerd Hoffmann escreveu: > > > 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 gnome-terminal: [acme@felicio ~]$ ./a.sh foreground: no response background: no response [acme@felicio ~]$ :-( - Arnaldo