From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [F.A.Q.] the advantages of a shared tool/kernel Git repository, tools/perf/ and tools/kvm/ Date: Thu, 10 Nov 2011 09:39:00 +0100 Message-ID: <4EBB8DA4.1080907@redhat.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 To: Jim Paris Return-path: 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 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