From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Istvan Marko Newsgroups: gmane.emacs.bugs Subject: bug#32072: 27.0.50; clear-face-cache in an X frame breaks tty colors Date: Fri, 06 Jul 2018 10:18:39 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1530912618 861 195.159.176.226 (6 Jul 2018 21:30:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 6 Jul 2018 21:30:18 +0000 (UTC) To: 32072@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 06 23:30:14 2018 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 1fbYIv-00007D-HL for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Jul 2018 23:30:13 +0200 Original-Received: from localhost ([::1]:59705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbYL2-0000gJ-MH for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Jul 2018 17:32:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbYKk-0000by-L9 for bug-gnu-emacs@gnu.org; Fri, 06 Jul 2018 17:32:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbYKg-0004R9-LU for bug-gnu-emacs@gnu.org; Fri, 06 Jul 2018 17:32:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40966) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fbYKg-0004R1-Hb for bug-gnu-emacs@gnu.org; Fri, 06 Jul 2018 17:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fbYKg-0002Mp-Aj for bug-gnu-emacs@gnu.org; Fri, 06 Jul 2018 17:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Istvan Marko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Jul 2018 21:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32072 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15309126959035 (code B ref -1); Fri, 06 Jul 2018 21:32:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Jul 2018 21:31:35 +0000 Original-Received: from localhost ([127.0.0.1]:48859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbYKE-0002Le-IL for submit@debbugs.gnu.org; Fri, 06 Jul 2018 17:31:34 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbUNl-0004aR-8u for submit@debbugs.gnu.org; Fri, 06 Jul 2018 13:18:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbUNf-0002WR-0I for submit@debbugs.gnu.org; Fri, 06 Jul 2018 13:18:52 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39607) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fbUNe-0002WN-TP for submit@debbugs.gnu.org; Fri, 06 Jul 2018 13:18:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbUNd-0003uE-Do for bug-gnu-emacs@gnu.org; Fri, 06 Jul 2018 13:18:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbUNY-0002VX-DD for bug-gnu-emacs@gnu.org; Fri, 06 Jul 2018 13:18:49 -0400 Original-Received: from imarko.xen.prgmr.com ([71.19.158.228]:54418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbUNY-0002Ug-3M for bug-gnu-emacs@gnu.org; Fri, 06 Jul 2018 13:18:44 -0400 Original-Received: from localhost ([127.0.0.1] helo=zsu.kismala.com) by imarko.xen.prgmr.com with esmtp (Exim 4.90_1) (envelope-from ) id 1fbUNT-0000l3-Oc for bug-gnu-emacs@gnu.org; Fri, 06 Jul 2018 10:18:39 -0700 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Fri, 06 Jul 2018 17:31:33 -0400 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:148271 Archived-At: When an Emacs session has both an X11 frame and a tty frame on a 256 color capable terminal calling (clear-face-cache) in the X11 frame results in the colors getting messed up in the existing tty frame. Newly created tty frames are OK. Running (clear-face-cache) in the tty frame fixes the affected frame. Non-256-color tty frames don't seem to be affected. I am running into this regularly because I often have Emacs sessions with both X and tty frames, switching back and forth between them. Sometimes when I switch back to the tty frame I find that the colors are messed up. I suspect that this is triggered by redisplay_internal periodically calling clear-face-cache. I am able to reproduce this with the current master and emacs-26 using the following steps: Start Emacs in X11 mode and start Emacs server: emacs -Q M-x server-start Then in a 256 color terminal with TERM=xterm-256color or similar: emacsclient -t Then switch back to the X frame and evaluate: M-: (clear-face-cache) RET This immediately corrupts the colors of the tty frame. Not sure if all faces are affected but the mode-line face for example always turns black or green for me so it's very obvious. Running (clear-face-cache) in the tty frame restores the correct tty faces. The X frame is not affected. Looking at the git log e573d08ef15f0431ad8289b4242c49826f20efb6 ("Make face realization be more frame-specific") seems like a potential suspect but unfortunately I am no longer able to build that revision on my Linux hosts (temacs loading gobbles up all available memory for some reason) In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu) of 2018-07-06 built on somehost Repository revision: 3bbd4ffc68bcc2b3e003a2179a508b82055ad770 Windowing system distributor 'The X.Org Foundation', version 11.0.11905000 System Description: Linux Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. user-error: Beginning of history; no preceding item Configured using: 'configure --without-x-toolkit --without-gpm --without-rsvg --without-gconf --without-xim --without-gsettings --with-file-notification=inotify --without-lcms2' Configured features: XPM JPEG TIFF GIF PNG IMAGEMAGICK SOUND DBUS NOTIFY ACL GNUTLS LIBXML2 FREETYPE XFT ZLIB OLDXMENU X11 THREADS Important settings: value of $LANG: C locale-coding-system: nil Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting font-render-setting x multi-tty make-network-process emacs) Memory information: ((conses 16 95891 6947) (symbols 48 20447 1) (miscs 40 40 85) (strings 32 29147 1543) (string-bytes 1 759273) (vectors 16 15030) (vector-slots 8 508852 6900) (floats 8 52 65) (intervals 56 243 142) (buffers 992 12))