unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Tim Landscheidt <tim@tim-landscheidt.de>
Cc: 29473@debbugs.gnu.org
Subject: bug#29473: 25.3; 'background-mode is 'light on console with black background
Date: Sat, 09 Dec 2017 09:05:05 -0500	[thread overview]
Message-ID: <87y3mcdmjy.fsf@users.sourceforge.net> (raw)
In-Reply-To: <87efo4ihul.fsf@passepartout.tim-landscheidt.de> (Tim Landscheidt's message of "Sat, 09 Dec 2017 05:35:30 +0000")


Tim Landscheidt <tim@tim-landscheidt.de> 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?






  reply	other threads:[~2017-12-09 14:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 14:53 bug#29473: 25.3; 'background-mode is 'light on console with black background Tim Landscheidt
2017-12-02 15:25 ` Noam Postavsky
2017-12-09  5:35   ` Tim Landscheidt
2017-12-09 14:05     ` Noam Postavsky [this message]
2021-09-03  6:44       ` Lars Ingebrigtsen
2021-10-03  9:44         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y3mcdmjy.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=29473@debbugs.gnu.org \
    --cc=tim@tim-landscheidt.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).