From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#29473: 25.3; 'background-mode is 'light on console with black background Date: Sat, 09 Dec 2017 09:05:05 -0500 Message-ID: <87y3mcdmjy.fsf@users.sourceforge.net> References: <87efoj3h91.fsf@passepartout.tim-landscheidt.de> <87a7z1jgn8.fsf@users.sourceforge.net> <87efo4ihul.fsf@passepartout.tim-landscheidt.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1512828369 8374 195.159.176.226 (9 Dec 2017 14:06:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 9 Dec 2017 14:06:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: 29473@debbugs.gnu.org To: Tim Landscheidt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 09 15:06:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNflV-00022I-Mw for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Dec 2017 15:06:05 +0100 Original-Received: from localhost ([::1]:41506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNfld-0005nK-0k for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Dec 2017 09:06:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNflX-0005n2-79 for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 09:06:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNflS-0000Rq-7h for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 09:06:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44553) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eNflS-0000RQ-3A for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 09:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eNflR-0000XK-Rz for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2017 09:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Dec 2017 14:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29473 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29473-submit@debbugs.gnu.org id=B29473.15128283172011 (code B ref 29473); Sat, 09 Dec 2017 14:06:01 +0000 Original-Received: (at 29473) by debbugs.gnu.org; 9 Dec 2017 14:05:17 +0000 Original-Received: from localhost ([127.0.0.1]:53234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNfkh-0000WL-IP for submit@debbugs.gnu.org; Sat, 09 Dec 2017 09:05:16 -0500 Original-Received: from mail-it0-f44.google.com ([209.85.214.44]:45578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eNfkf-0000W8-KE for 29473@debbugs.gnu.org; Sat, 09 Dec 2017 09:05:14 -0500 Original-Received: by mail-it0-f44.google.com with SMTP id z6so8778144iti.4 for <29473@debbugs.gnu.org>; Sat, 09 Dec 2017 06:05:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=8iqlY1Ks17wpGDtxLMaxkd4mf1cdI/GsYm6m1YF/xq8=; b=IdgZs4CADpr7D4LmTb7kKnHV3VzXIfGtPuAqGBVkf63ecpmv6TgEdwh4SMcCXE1pqD 2sfCcscZQbALwh/1l++ZI97nb/Y9pbnpYdM3e4QWCrDr6mC2xcMCuvC6YsZdqjF9wMPr 1Ut5H/26yLdjGXR0DiD7ITw3862At8vmwDBD5ay3xC5py81fdoEDrMxP1qByTKM+MbfF EFjDNNYKyrpVtanxYrWOTYV9HbvJFLeeMUnNLN22fhsYhZnaoCcBy0Txqg7pfYYyi7mk qBxlfgmKHxG+a0HhmDX4nz1YGNLg3ahYO4c6/3GKXbYTwD4GSMtd7u0EVrKUjlHJZ/3d uCgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=8iqlY1Ks17wpGDtxLMaxkd4mf1cdI/GsYm6m1YF/xq8=; b=mhEW9WlCVMmsdtgXDD7/hsG8hTUSsret9X/rUwq9aSuSPOnb4aA18EyQasT8Fw63gK 1SF7u488ELtkuDTgu6qKAtxAKiUD4sZ8SnYrVD74hTulQZ3wmXfwvawefU7j/Dz5Xq/o p2+r9u5ABZ5RJ2yn2hTYd7fU6qg6+rg701a2AQIEnj2rtYMxh9EzJf6KYZXpWQ5SpJyO KEaDgDBJEDnHpokKTV9Iz3Skqgw2YNVyD7TQkDEF9KJkJCAq8IzvVVhUxLLWfCwyrUZz GL3JeO2o/vOAz2c9w3R9A2E3FnAWl6NVw4ZbpEUs2FuA+5WsxHevJgrZclhVFJfEWejq OWIA== X-Gm-Message-State: AKGB3mJ8WslrTRsX8/+Sr0dIHTZ1hrxsmyPOfINTXNfkBCl/9acVUos1 lBMxmq054Wm1uCn4xkUS+SPJDw== X-Google-Smtp-Source: ACJfBosAAsZx5ZoNehqGo3YqkWN9fqk2shlrLh017PR1wYCPvTs9f3/yKhxImOy0dTf8X+Cjwid8tQ== X-Received: by 10.36.131.200 with SMTP id d191mr2001388ite.97.1512828307728; Sat, 09 Dec 2017 06:05:07 -0800 (PST) Original-Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id z27sm1867586ita.13.2017.12.09.06.05.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Dec 2017 06:05:06 -0800 (PST) In-Reply-To: <87efo4ihul.fsf@passepartout.tim-landscheidt.de> (Tim Landscheidt's message of "Sat, 09 Dec 2017 05:35:30 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140856 Archived-At: Tim Landscheidt writes: > With interspersed message calls, I could find out that kon- > sole's response to the "Secondary Device Attributes (DA)" > query in terminal-init-xterm ("\e[>0c") is "^[[>0;115;0c": > > | [tim@passepartout ~/src/emacs]$ perl -we 'print "\e[>0c";'; sleep 1; echo > | ^[[>0;115;0c > | [tim@passepartout ~/src/emacs]$ > > This version number (115) falls short of the test > "(>= version 242)" which would cause the background colour > to be queried, and rightly so, because konsole does not re- > spond to the query "\e]11;?\e\\": > > | [tim@passepartout ~/src/emacs]$ perl -we 'print "\e]11;?\e\\";'; sleep 1; echo > > | [tim@passepartout ~/src/emacs]$ > (Sidenote: gnome-terminal reports back "^[[>1;4603;0c" and > "^[]11;rgb:2323/2727/2929^[\" but the latter is never que- > ried due to NUMBER1 being 1 and NUMBER2 being greater than > 2000, so background-mode stills end up as 'light with gnome- > terminal.) Ah, interesting. It seems the versions of gnome-terminal are rather non-standard. Which version of gnome-terminal is this, and does it support the other xterm calls? ;; If version is 216 (the version when modifyOtherKeys was ;; introduced) or higher, initialize the ;; modifyOtherKeys support. (when (>= version 216) (xterm--init-modify-other-keys)) ;; In version 203 support for accessing the X selection was ;; added. Hterm reports itself as version 256 and supports it ;; as well. gnome-terminal doesn't and is excluded by this ;; test. (when (>= version 203) ;; Most xterms seem to have it disabled by default, and if it's ;; disabled, C-y will incur a timeout, so we only use it if the user ;; explicitly requests it. ;;(xterm--init-activate-get-selection) (xterm--init-activate-set-selection)))))) > So then I tried to track down where background-mode's 'light > is actually coming from, and it seems to originate in > frame-set-background-mode's: > > | (default-bg-mode > | (if (or (window-system frame) > | (and tty-type > | (string-match "^\\(xterm\\|\\rxvt\\|dtterm\\|eterm\\)" ^^ Hmm, those backslashes are a bug, I think. > | tty-type))) > | 'light > | 'dark)) > > with tty-type being "xterm-256color". > My assumption now is that Emacs's detection mechanism cannot > be "fixed" for konsole in Fedora 25 and I should manually > set frame-background-mode to 'dark. Yes, looks like there is no way for Emacs to detect it. > But: In Fedora 26, konsole 17.04.1 (in contrast to Fedora > 25's konsole 16.12.3) still returns "^[[>0;115;0c" as > version number, /but/ "\^[]11;rgb:0000/0000/0000^G" for the > background colour. Thanks for tracking all these details down! > So one possible improvement could be to query the background > colour either unconditionally or also on "(= version 115)". > This would increase the start-up time by (at most) two se- > conds (xterm-query-timeout) for terminals that do not sup- > port this query AFAIUI. Hmm, I think 2 seconds is too much. Is there no way to distinguish between konsole versions? Perhaps file a bug against konsole to ask them to bump the reported version?