From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: RFC: comint.el - comint-highlight-prompt and unreadable colors Date: Mon, 26 Mar 2007 09:24:37 -0700 Message-ID: <200703261624.l2QGOcBr011707@oogie-boogie.ics.uci.edu> References: <87y7llxxdu.fsf@catnip.gol.com> <87slbsyjn7.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1174926470 11653 80.91.229.12 (26 Mar 2007 16:27:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Mar 2007 16:27:50 +0000 (UTC) Cc: emacs-devel@gnu.org, Jari Aalto To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 26 18:27:33 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HVs2Z-0000Mj-9H for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2007 18:27:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HVs4p-0007zY-41 for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2007 11:29:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HVs4m-0007zS-Bl for emacs-devel@gnu.org; Mon, 26 Mar 2007 12:29:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HVs4k-0007zG-Tl for emacs-devel@gnu.org; Mon, 26 Mar 2007 12:29:43 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HVs4k-0007zD-O8 for emacs-devel@gnu.org; Mon, 26 Mar 2007 11:29:42 -0500 Original-Received: from oogie-boogie.ics.uci.edu ([128.195.1.41]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HVs2T-0008Dl-2l; Mon, 26 Mar 2007 12:27:21 -0400 Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by oogie-boogie.ics.uci.edu (8.13.6/8.13.6) with ESMTP id l2QGOcBr011707; Mon, 26 Mar 2007 09:24:38 -0700 (PDT) In-Reply-To: (Miles Bader's message of "Mon\, 26 Mar 2007 14\:44\:32 +0900") Original-Lines: 38 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-0.763, required 5, autolearn=disabled, ALL_TRUSTED -1.44, J_CHICKENPOX_62 0.60, TW_RX 0.08) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-kernel: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:68624 Archived-At: Miles Bader writes: > Jari Aalto writes: > > Have a look at these: > > > > 1) On Windows, terminal Putty, which is very popular free SSH terminal. > > > > http://cante.net/~jaalto/tmp/bug/emacs/m-x-shell-color--win32-putty.jpg > ... > > 2) On windows, displaying a rxvt terminal back to the Cygwin X11 server > > from a Unix host using "-bg black -fg snow" > > > > http://cante.net/~jaalto/tmp/bug/emacs/m-x-shell-color--rxvt-cygwin-X11.jpg > > In both cases it looks like Emacs doesn't realize that it's on a > dark-background terminal, and is using light-background mode (which > indeed defaults to a darkish blue for comint prompts). > > This is a common problem, because Emacs generally _cannot_ tell the > background color on a terminal, so it has to guess; I don't know about > windows, but on X11 it defaults to assuming dark-background on terminals > unless the TERM environment variable is "xterm". If TERM = "xterm", > Emacs assumes a light background. > > Since rxvt sets TERM to "xterms", that's almost certainly what's > happening in the 2nd case. On windows, I don't know, but it's probably > a similar problem. If the term is rxvt, then it's not a good idea to set TERM to xterms. With "xterms" no term/*.el terminal initialization file is run! rxvt sets the variable COLORFGBG to show the default foreground and background. Based on COLORFGBG that term/rxvt.el can determine the default background color, and correctly decide if the background is light or dark. Unfortunately other terminals do not have such a feature...