From unknown Sun Jun 22 07:53:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28340: 26.0.50; xterm frame titles Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Sep 2017 21:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28340 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 28340@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.150447467131807 (code B ref -1); Sun, 03 Sep 2017 21:38:01 +0000 Received: (at submit) by debbugs.gnu.org; 3 Sep 2017 21:37:51 +0000 Received: from localhost ([127.0.0.1]:46983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1docaV-0008Gx-AB for submit@debbugs.gnu.org; Sun, 03 Sep 2017 17:37:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1docaS-0008Gj-HP for submit@debbugs.gnu.org; Sun, 03 Sep 2017 17:37:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1docaI-00017Q-9A for submit@debbugs.gnu.org; Sun, 03 Sep 2017 17:37:42 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46436) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1docaI-00017J-5M for submit@debbugs.gnu.org; Sun, 03 Sep 2017 17:37:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1docaD-0000pN-9I for bug-gnu-emacs@gnu.org; Sun, 03 Sep 2017 17:37:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1doca8-00013P-KT for bug-gnu-emacs@gnu.org; Sun, 03 Sep 2017 17:37:33 -0400 Received: from mail-qk0-x231.google.com ([2607:f8b0:400d:c09::231]:35510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1doca8-00012B-FB for bug-gnu-emacs@gnu.org; Sun, 03 Sep 2017 17:37:28 -0400 Received: by mail-qk0-x231.google.com with SMTP id p67so16533617qkd.2 for ; Sun, 03 Sep 2017 14:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=3kCh7BcrzwMP7JWLMs5fcHzSEvLE5EROLhkHRLusjXs=; b=dsyP/8vVQFQZrGv4bIHzPLlJTMOH4iJdVJgr57Iu+Gjb8vR59uY9qFkVZAjQiGUWtu 9x1PjJnZEmhctmiTnPYiznIzgtjKPREm/enS6tHLwE1gWSrKyXom2gWDB95svn9sfDlB GSs3EjPRXzNrBDw+U7OAsgEkL93NIpPeBwJzxpxLJi/68piLlTWzotLD/TnwHdhOeBI3 LOLGLLeWLKpDBEWsgDQGoraZeMqf885XUWnE8dzM0B3ilde6bMmqrQ7a7DH8zr7sT/zz Hi0OBuf+OGL8GVnrRnpFBVwopcl9k6yQme7HRTdG4W2sOO1EwOJZFAoL60mnGan7OPIz AW/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=3kCh7BcrzwMP7JWLMs5fcHzSEvLE5EROLhkHRLusjXs=; b=Pgtlp3DWzv15oZ7KoqoNJJsyUo2Fj/08Y39PlHbjJrAzs3B4+VwviDBfDDpH7GqNpJ BxVQWUfT0iGY3rEH/gTGSLNNAn8MajUNb7Qbu+hDOETEa9DyNL5Wzv8+pONs/3S8J4yQ tRzRbs3zVkFlwtX9dG1gm6CmK8HYrOjr54U1ZDOKX8vhv5zsPsl2XEM8KzjOwMWmwxG0 ayKGnsMlR62nVApICoJALax2ulYVSkbJhItb8fHY7QsGyXjfjQKTCsj9Zo4N5sxAjKb6 GnqxeBsTXBVxM/JDkcJbYdKXLL6kc2QH88UP3y+BWKaO/a6jehCYUh6Sdga3EplvpPx2 5dzQ== X-Gm-Message-State: AHPjjUjHjJF4lIufcpiYmFhher52z6uiPwh7lTSziJcnGdA2Tgp0TYMV EI9mo5iFnqZTN1kC6hmXSg== X-Google-Smtp-Source: ADKCNb4GuKMy7i6oCrMmBbbsxFYE4go69ebk5/t1Ar4/MyMl3YYr52YOwgM2vq7NbuPFQpfrQzCTCw== X-Received: by 10.55.70.75 with SMTP id t72mr10965435qka.14.1504474646359; Sun, 03 Sep 2017 14:37:26 -0700 (PDT) Received: from holos.localdomain (pool-173-64-88-95.bltmmd.fios.verizon.net. [173.64.88.95]) by smtp.gmail.com with ESMTPSA id j129sm2756419qkd.92.2017.09.03.14.37.25 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Sep 2017 14:37:25 -0700 (PDT) Received: by holos.localdomain (Postfix, from userid 1000) id AC46666207; Sun, 3 Sep 2017 17:37:24 -0400 (EDT) From: Mark Oteiza Date: Sun, 03 Sep 2017 17:37:24 -0400 Message-ID: <87h8wjo44r.fsf@holos> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.4 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.4 (----) Wishlist item. Hi, I tacked setting window/iconified window titles into term/xterm.el, but found a quirk I suspect is related to Bug#18137 (which refers to 42fe2e88d and Bug#15025). Because clients don't always have focus, opening a new client won't trigger hooks that I would think trigger, perhaps even after-make-frame-functions or window-size-change-functions. diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index e6d224dd3d..03dd516ebf 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -802,6 +802,7 @@ terminal-init-xterm (when (memq 'setSelection xterm-extra-capabilities) (xterm--init-activate-set-selection))) + (xterm--init-frame-title) ;; Unconditionally enable bracketed paste mode: terminals that don't ;; support it just ignore the sequence. (xterm--init-bracketed-paste-mode) @@ -828,6 +829,22 @@ xterm--init-activate-set-selection "Terminal initialization for `gui-set-selection'." (set-terminal-parameter nil 'xterm--set-selection t)) +(defun xterm--init-frame-title () + "Terminal initialization for `gui-set-selection'." + (xterm-set-window-title) + (add-hook 'post-command-hook 'xterm-set-window-title) + (add-hook 'minibuffer-exit-hook 'xterm-set-window-title)) + +(defun xterm-set-window-title () + "Set the window title of the Xterm with the current Emacs frame." + (send-string-to-terminal + (format "\e]2;%s\a" (format-mode-line frame-title-format)))) + +(defun xterm-set-icon-title () + "Set the window title of the Xterm with the current Emacs frame." + (send-string-to-terminal + (format "\e]1;%s\a" (format-mode-line icon-title-format)))) + (defun xterm--selection-char (type) (pcase type ('PRIMARY "p") From unknown Sun Jun 22 07:53:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28340: 26.0.50; xterm frame titles Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Sep 2017 04:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28340 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mark Oteiza Cc: 28340@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 28340-submit@debbugs.gnu.org id=B28340.15044986802316 (code B ref 28340); Mon, 04 Sep 2017 04:18:01 +0000 Received: (at 28340) by debbugs.gnu.org; 4 Sep 2017 04:18:00 +0000 Received: from localhost ([127.0.0.1]:47379 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1doipk-0000bI-4N for submit@debbugs.gnu.org; Mon, 04 Sep 2017 00:18:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1doipi-0000b6-Jo for 28340@debbugs.gnu.org; Mon, 04 Sep 2017 00:17:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1doioZ-00042g-HH for 28340@debbugs.gnu.org; Mon, 04 Sep 2017 00:17:53 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1doioZ-00042S-AW; Mon, 04 Sep 2017 00:16:47 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1357 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1doioY-0004k3-FB; Mon, 04 Sep 2017 00:16:47 -0400 Date: Mon, 04 Sep 2017 07:16:42 +0300 Message-Id: <83mv6b2j4l.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87h8wjo44r.fsf@holos> (message from Mark Oteiza on Sun, 03 Sep 2017 17:37:24 -0400) References: <87h8wjo44r.fsf@holos> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Mark Oteiza > Date: Sun, 03 Sep 2017 17:37:24 -0400 > > Wishlist item. > > Hi, > > I tacked setting window/iconified window titles into term/xterm.el, but Thanks. This needs a NEWS entry, and I think there should be a defcustom to turn this off, for those who'd like the default title provided by xterm. > found a quirk I suspect is related to Bug#18137 (which refers to > 42fe2e88d and Bug#15025). Because clients don't always have focus, > opening a new client won't trigger hooks that I would think trigger, > perhaps even after-make-frame-functions or window-size-change-functions. Maybe one of the hooks provided by server.el would fit the bill? From unknown Sun Jun 22 07:53:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28340: 26.0.50; xterm frame titles Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Sep 2017 01:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28340 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 28340@debbugs.gnu.org Received: via spool by 28340-submit@debbugs.gnu.org id=B28340.150517929122036 (code B ref 28340); Tue, 12 Sep 2017 01:22:01 +0000 Received: (at 28340) by debbugs.gnu.org; 12 Sep 2017 01:21:31 +0000 Received: from localhost ([127.0.0.1]:34380 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drZtL-0005jL-I7 for submit@debbugs.gnu.org; Mon, 11 Sep 2017 21:21:31 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:36271) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drZtK-0005j9-4a for 28340@debbugs.gnu.org; Mon, 11 Sep 2017 21:21:30 -0400 Received: by mail-qk0-f195.google.com with SMTP id i14so6419680qke.3 for <28340@debbugs.gnu.org>; Mon, 11 Sep 2017 18:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pkTEi21mozXh7OKW/5OdIe5BQykc2LRBRZQ9au+JoT0=; b=AgamkrbL7p3aysqdTGAVIY971Wm8iWHxiftw8QC+18jJuzVt3lMTdErfggjx14uCGh lfut86gF/ZIb1Xb5k/3h0OVEB00OeVQU/xEGv44JFT60nCL7c1CGHN8uawZrhk/y4nQK TB8/Xd9rZbupybinKA/lskfXliJbV4V2QJexZxigO9+eJ5VHY4HiZwHVipq7BRmlpg8h UnPRAmkwlK2m7ej7dpPRdJKovgef/ueQHriWo1nOjnb72MG+l5m4IEt/RDQCGONjHqoK ja/XLRTplarHMXBjAf1FlMW5Kk527MwdvRthkH9TsZ8j1FobsJex/hX5V+y3832pIeLT nLAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pkTEi21mozXh7OKW/5OdIe5BQykc2LRBRZQ9au+JoT0=; b=iDJ0kcbUodivJfMlUpLUNqRZcSv069yH9fDuFqo4/VjGJBqqjk7vbnN9hxJBNG4VcZ O1uV+MXYnZNstiREDCC20TMAm9Js8C4NFC8qnH/vvuXmqsl9zOIyjNLFtvlBf+pF1M2K 3ecYcywAyCuCCJwQOgDSx2Eblq5YbOqKIpioeYj30YADGLxM9/WMHM5BEE+QwBhA7OuX SAYmicVFGH0564sQ3cFIz2/jJI6dGYuTvxkExZlwL9G9wV4i58QAVexNh2XzyO6AJRTL 3FbeZIxHeQowreZYdLYAxYmHBGUIMnaBtnAuXQlpqGajng5UszKTGA731XNVqK2rQa28 rxng== X-Gm-Message-State: AHPjjUj7QJUJJQy5cwjo8VuX+7phWSSVr1H0lLUFizl8bt8+nwrDQCqz PfDymy5HE4EjZWSHWJOpMw== X-Google-Smtp-Source: AOwi7QC30uo2lY3OwdSrNyj8BqS5aFKTIu+GSIe7rT/t3VD+sbaAiVydfELOmHWRdcCnvgwQ+GQNyg== X-Received: by 10.55.215.211 with SMTP id t80mr11371973qkt.30.1505179284365; Mon, 11 Sep 2017 18:21:24 -0700 (PDT) Received: from holos.localdomain (pool-173-67-36-61.bltmmd.fios.verizon.net. [173.67.36.61]) by smtp.gmail.com with ESMTPSA id o9sm6947423qte.71.2017.09.11.18.21.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Sep 2017 18:21:23 -0700 (PDT) Received: by holos.localdomain (Postfix, from userid 1000) id 26EDB68E70; Mon, 11 Sep 2017 21:21:22 -0400 (EDT) Date: Mon, 11 Sep 2017 21:21:22 -0400 From: Mark Oteiza Message-ID: <20170912012122.GA11282@holos.localdomain> References: <87h8wjo44r.fsf@holos> <83mv6b2j4l.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83mv6b2j4l.fsf@gnu.org> User-Agent: Mutt/1.9.0 (2017-09-02) X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 04/09/17 at 07:16am, Eli Zaretskii wrote: > > From: Mark Oteiza > > Date: Sun, 03 Sep 2017 17:37:24 -0400 > > I tacked setting window/iconified window titles into term/xterm.el, but > > Thanks. This needs a NEWS entry, and I think there should be a > defcustom to turn this off, for those who'd like the default title > provided by xterm. Ok. > > found a quirk I suspect is related to Bug#18137 (which refers to > > 42fe2e88d and Bug#15025). Because clients don't always have focus, > > opening a new client won't trigger hooks that I would think trigger, > > perhaps even after-make-frame-functions or window-size-change-functions. > > Maybe one of the hooks provided by server.el would fit the bill? Nope, none of those appear relevant, and hooking into them does nothing apparent. Even doing the following, I get the title as the selected buffer in the previously selected frame. Messaging (frame-list) in xterm-test shows that the car of the list is always the new frame, but still the frame title is incorrect--a new frame created by emacsclient -t ends up on the scratch buffer. I say "ends up" because sometimes I see another buffer flash before I see the scratch buffer. This all seems a little buggy to me, but I know Bug#18137 and its ancestors were tough. (defun xterm--init-frame-title () "Terminal initialization for `gui-set-selection'." (xterm-set-window-title) (add-hook 'after-make-frame-functions 'xterm-test) (add-hook 'server-switch-hook 'xterm-test) ;; (add-hook 'window-size-change-functions 'xterm-set-window-title) ;; (add-hook 'post-command-hook 'xterm-set-window-title) ;; (add-hook 'minibuffer-exit-hook 'xterm-set-window-title) ) (defun xterm-test (&optional frame) (select-frame (car (frame-list))) (xterm-set-window-title frame)) From unknown Sun Jun 22 07:53:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28340: 26.0.50; xterm frame titles Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Sep 2017 07:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28340 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mark Oteiza Cc: 28340@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 28340-submit@debbugs.gnu.org id=B28340.150589367124995 (code B ref 28340); Wed, 20 Sep 2017 07:48:02 +0000 Received: (at 28340) by debbugs.gnu.org; 20 Sep 2017 07:47:51 +0000 Received: from localhost ([127.0.0.1]:49045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duZjZ-0006V2-IK for submit@debbugs.gnu.org; Wed, 20 Sep 2017 03:47:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duZjV-0006Uo-W7 for 28340@debbugs.gnu.org; Wed, 20 Sep 2017 03:47:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duZjM-0006O1-Ql for 28340@debbugs.gnu.org; Wed, 20 Sep 2017 03:47:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duZjM-0006NW-Nm; Wed, 20 Sep 2017 03:47:36 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3026 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1duZjK-0000e0-SS; Wed, 20 Sep 2017 03:47:35 -0400 Date: Wed, 20 Sep 2017 10:47:26 +0300 Message-Id: <83poalg6b5.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <20170912012122.GA11282@holos.localdomain> (message from Mark Oteiza on Mon, 11 Sep 2017 21:21:22 -0400) References: <87h8wjo44r.fsf@holos> <83mv6b2j4l.fsf@gnu.org> <20170912012122.GA11282@holos.localdomain> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Mon, 11 Sep 2017 21:21:22 -0400 > From: Mark Oteiza > Cc: 28340@debbugs.gnu.org > > > Maybe one of the hooks provided by server.el would fit the bill? > > Nope, none of those appear relevant, and hooking into them does nothing > apparent. Even doing the following, I get the title as the selected > buffer in the previously selected frame. > > Messaging (frame-list) in xterm-test shows that the car of the list is > always the new frame, but still the frame title is incorrect--a new > frame created by emacsclient -t ends up on the scratch buffer. I say > "ends up" because sometimes I see another buffer flash before I see the > scratch buffer. This all seems a little buggy to me, but I know > Bug#18137 and its ancestors were tough. What about window-configuration-change-hook, does that help? You could set some flag in after-make-frame-functions, and then test and reset that flag in window-configuration-change-hook, when you see that a buffer is switched in the frame. Would that work? From unknown Sun Jun 22 07:53:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28340: 26.0.50; xterm frame titles Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Sep 2017 12:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28340 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 28340@debbugs.gnu.org Received: via spool by 28340-submit@debbugs.gnu.org id=B28340.150591024031566 (code B ref 28340); Wed, 20 Sep 2017 12:24:01 +0000 Received: (at 28340) by debbugs.gnu.org; 20 Sep 2017 12:24:00 +0000 Received: from localhost ([127.0.0.1]:49139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1due2q-0008D4-Gs for submit@debbugs.gnu.org; Wed, 20 Sep 2017 08:24:00 -0400 Received: from mail-qk0-f182.google.com ([209.85.220.182]:56464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1due2o-0008Cr-Sd for 28340@debbugs.gnu.org; Wed, 20 Sep 2017 08:23:59 -0400 Received: by mail-qk0-f182.google.com with SMTP id u7so2450004qku.13 for <28340@debbugs.gnu.org>; Wed, 20 Sep 2017 05:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=j5vlZjddvTiICFw8x3UfpSe5srghT07N5+/VqUItumU=; b=OSbSpGK0pVWXzHilEX6wkcVy1mBCegJElELZ5z9uSg7ExbQ4ocFFSoPO4frN4V/Scb esDvpVEn7A9brpz4cPO9qVR8Gg5APwtgS7aINgzqlRqQeT9bTW2J1mwrEGTz14WM0XiK 6VB+kbLYbRkN2Pq++SMrVIgHaTMcTr2GqVQ8sVgjhHm6zvxveEqBFPNjb+TZr9lIX2eF DsllQ0szV3nnnGPDPW0y8nCpYLrYNasFafsQj2OgChKbOzzZ4FDXMOT5Ur6OsVFfREEd AYD6n/8oW4scAWqbMwE4fwOd9zF74rVOm4x/Rwx/7bBAfPE0bGGZS2iNZjsjmcdloszg gE4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=j5vlZjddvTiICFw8x3UfpSe5srghT07N5+/VqUItumU=; b=Yb4Z9X57Q/96FTLzLY0XS11jysaBdl1M0Pof9+bGYzd6X0h4NTN8JxxCIBAUJchYjG DVucnth2mUYLl3/VRbM6C7oHI3gTZJSD7+hA/YJIrOQd+5V4xHwaUASTCYKO1CWd9oNc YsStnUIT2YscZXwj1q30qUDzKossg/ppLdh3j8w3kbRWX9GePrrZ2NyD5O0zYrGVUxx7 QeR1ZhH28aHBss6Dw3vHm2BAySyrTYX3FSa4Qi/KjmMrZ3lfurtIanUfKZCwipAJLBsx f7XPKNgJttboGBQEHJa6p3DLiKafXDm//wXQ2FWYaAYid7vTu3NRp6VyNW1HzrOJl4IS mhlg== X-Gm-Message-State: AHPjjUjZMveX2Sub5ikTdSDpy+nE+X4OiyMOR9g+1B1QdI7w6bswO1RG jhl83JOoDYKeC3OIgZmqx8Wt/Q== X-Google-Smtp-Source: AOwi7QBbWHeTuN8956iiNwgcah6coYSVIXq/5+ejtTepCo9IFe3bj6s38E1eGUkCeLqynbYO18jNpg== X-Received: by 10.55.79.85 with SMTP id d82mr6478542qkb.5.1505910233217; Wed, 20 Sep 2017 05:23:53 -0700 (PDT) Received: from logos.localdomain (pool-173-67-36-61.bltmmd.fios.verizon.net. [173.67.36.61]) by smtp.gmail.com with ESMTPSA id e18sm1227528qtc.59.2017.09.20.05.23.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Sep 2017 05:23:51 -0700 (PDT) Date: Wed, 20 Sep 2017 08:23:51 -0400 From: Mark Oteiza Message-ID: <20170920122351.wx43g7m72xyxc37w@logos.localdomain> References: <87h8wjo44r.fsf@holos> <83mv6b2j4l.fsf@gnu.org> <20170912012122.GA11282@holos.localdomain> <83poalg6b5.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83poalg6b5.fsf@gnu.org> User-Agent: NeoMutt/20170912-13-728bb5 X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 20/09/17 at 07:47am, Eli Zaretskii wrote: > > Date: Mon, 11 Sep 2017 21:21:22 -0400 > > From: Mark Oteiza > > Cc: 28340@debbugs.gnu.org > > > > > Maybe one of the hooks provided by server.el would fit the bill? > > > > Nope, none of those appear relevant, and hooking into them does nothing > > apparent. Even doing the following, I get the title as the selected > > buffer in the previously selected frame. > > > > Messaging (frame-list) in xterm-test shows that the car of the list is > > always the new frame, but still the frame title is incorrect--a new > > frame created by emacsclient -t ends up on the scratch buffer. I say > > "ends up" because sometimes I see another buffer flash before I see the > > scratch buffer. This all seems a little buggy to me, but I know > > Bug#18137 and its ancestors were tough. > > What about window-configuration-change-hook, does that help? You > could set some flag in after-make-frame-functions, and then test and > reset that flag in window-configuration-change-hook, when you see that > a buffer is switched in the frame. Would that work? This appears to work, thank you. Please see attached. diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 4f79703833..a11acbc4db 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -68,6 +68,11 @@ xterm-max-cut-length :version "25.1" :type 'integer) +(defcustom xterm-set-window-title t + "Whether Emacs should set window titles to an Emacs frame in an XTerm." + :version "27.1" + :type 'boolean) + (defconst xterm-paste-ending-sequence "\e[201~" "Characters send by the terminal to end a bracketed paste.") @@ -802,6 +807,8 @@ terminal-init-xterm (when (memq 'setSelection xterm-extra-capabilities) (xterm--init-activate-set-selection))) + (when xterm-set-window-title + (xterm--init-frame-title)) ;; Unconditionally enable bracketed paste mode: terminals that don't ;; support it just ignore the sequence. (xterm--init-bracketed-paste-mode) @@ -828,6 +835,31 @@ xterm--init-activate-set-selection "Terminal initialization for `gui-set-selection'." (set-terminal-parameter nil 'xterm--set-selection t)) +(defun xterm--init-frame-title () + "Terminal initialization for `gui-set-selection'." + (xterm-set-window-title) + (add-hook 'after-make-frame-functions 'xterm-set-window-title-flag) + (add-hook 'window-configuration-change-hook 'xterm-unset-window-title-flag) + (add-hook 'post-command-hook 'xterm-set-window-title) + (add-hook 'minibuffer-exit-hook 'xterm-set-window-title)) + +(defvar xterm-window-title-flag nil + "Whether the a new frame has been created, calling for a title update.") + +(defun xterm-set-window-title-flag (_frame) + (setq xterm-window-title-flag t)) + +(defun xterm-unset-window-title-flag () + (when xterm-window-title-flag + (setq xterm-window-title-flag nil) + (xterm-set-window-title))) + +(defun xterm-set-window-title (&optional terminal) + "Set the window title of the Xterm with the current Emacs frame." + (send-string-to-terminal + (format "\e]2;%s\a" (format-mode-line frame-title-format)) + terminal)) + (defun xterm--selection-char (type) (pcase type ('PRIMARY "p") From unknown Sun Jun 22 07:53:44 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28340: 26.0.50; xterm frame titles Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Sep 2017 15:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28340 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Mark Oteiza Cc: 28340@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 28340-submit@debbugs.gnu.org id=B28340.150592009815300 (code B ref 28340); Wed, 20 Sep 2017 15:09:02 +0000 Received: (at 28340) by debbugs.gnu.org; 20 Sep 2017 15:08:18 +0000 Received: from localhost ([127.0.0.1]:50277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dugbq-0003yh-A6 for submit@debbugs.gnu.org; Wed, 20 Sep 2017 11:08:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56326) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dugbo-0003yU-Jm for 28340@debbugs.gnu.org; Wed, 20 Sep 2017 11:08:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dugad-00053R-Lx for 28340@debbugs.gnu.org; Wed, 20 Sep 2017 11:08:09 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dugad-0004ZR-B5; Wed, 20 Sep 2017 11:07:03 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3536 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dufMR-0001w3-Dk; Wed, 20 Sep 2017 09:48:21 -0400 Date: Wed, 20 Sep 2017 16:47:54 +0300 Message-Id: <83k20tfpmd.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <20170920122351.wx43g7m72xyxc37w@logos.localdomain> (message from Mark Oteiza on Wed, 20 Sep 2017 08:23:51 -0400) References: <87h8wjo44r.fsf@holos> <83mv6b2j4l.fsf@gnu.org> <20170912012122.GA11282@holos.localdomain> <83poalg6b5.fsf@gnu.org> <20170920122351.wx43g7m72xyxc37w@logos.localdomain> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Wed, 20 Sep 2017 08:23:51 -0400 > From: Mark Oteiza > Cc: 28340@debbugs.gnu.org > > > What about window-configuration-change-hook, does that help? You > > could set some flag in after-make-frame-functions, and then test and > > reset that flag in window-configuration-change-hook, when you see that > > a buffer is switched in the frame. Would that work? > > This appears to work, thank you. Please see attached. Thanks, this LGTM. It needs a NEWS entry about the new defcustom, and then it can go in. From unknown Sun Jun 22 07:53:44 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mark Oteiza Subject: bug#28340: closed (Re: bug#28340: 26.0.50; xterm frame titles) Message-ID: References: <20170920160618.wf37ddonfmeblntm@logos.localdomain> <87h8wjo44r.fsf@holos> X-Gnu-PR-Message: they-closed 28340 X-Gnu-PR-Package: emacs Reply-To: 28340@debbugs.gnu.org Date: Wed, 20 Sep 2017 16:07:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1505923623-21102-1" This is a multi-part message in MIME format... ------------=_1505923623-21102-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #28340: 26.0.50; xterm frame titles which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 28340@debbugs.gnu.org. --=20 28340: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28340 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1505923623-21102-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 28340-done) by debbugs.gnu.org; 20 Sep 2017 16:06:30 +0000 Received: from localhost ([127.0.0.1]:50387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duhW9-0005TS-La for submit@debbugs.gnu.org; Wed, 20 Sep 2017 12:06:30 -0400 Received: from mail-qt0-f177.google.com ([209.85.216.177]:52178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duhW6-0005T8-4A for 28340-done@debbugs.gnu.org; Wed, 20 Sep 2017 12:06:27 -0400 Received: by mail-qt0-f177.google.com with SMTP id q4so3280070qtq.8 for <28340-done@debbugs.gnu.org>; Wed, 20 Sep 2017 09:06:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2omLjBqL6UsSO6XX4F4npGhPVEHKJjzMYVhbkzHRplI=; b=uhJtyU1o6qwY9tOoL5gwxZXrzCaCCJ5Zzx+YOnFxKfghtP6X4IkZ5p1srnwKdbB/SW 925C0ktAvSOxDPkUlJywlaSmXIZBmRxVz9eisBK5OdLaZ+V2IWtRsxNOMSQXtDP4IPMn BWtVoOALILouXlZBpS189KbXdaUBByogfy5dykz7t3ey/vdvU6FVApgsvyIE5er++pZa BCsz99HxSnHTT6bM4CrlGP8gtvY0lbYmoQHgsVknlhoWK4TVxW4EzxiScgc39L4XYoKO pJhtMycQwahAXJ7EBNyD4Jjjyb8qcqMfKal0GQushGRoytkMIOZC72nEQQI9RWVz/Lro wfsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2omLjBqL6UsSO6XX4F4npGhPVEHKJjzMYVhbkzHRplI=; b=DutherF0JsTAdSWY/iezOO5hUbd676IRG4/jm09YH0OoUU8pkl9R+fgXU8KYTxaUhV rJFfOGfzh9cZGm0AkOZKp1luf07jI5MMTqVJ+01yynp/X3Mf79hcCELNKAOH9w1u9p+t /b8cQVIP+Wc9/3UFp1JMRBV/7BUZ58bmIWInehNcjc8hY4AW0JNCpKxIoVF4EAXe5fE1 UBDCRfC6y4gzoSAlo5Wg3eeNcIxJ3xdaYuE9Y7kWMV0hBR9xQA6dZtE9J/JIbRWzLTPB Ojr2+dEL1gGwJN2Y2GiLDqDTE15mO6bKdNWxk6Yebcg0pSK6U95mo8ptjW8JgsruinWc VFIQ== X-Gm-Message-State: AHPjjUhW9cKUYFUhpd24qWvCKVQ+qv3NVs2dNPEcnHH/4NxnHe630PX7 qg8jRw/0eVaro5L1SU/qGHoVpg== X-Google-Smtp-Source: AOwi7QDfxwXxrgHrwGerAdj6lTEcBj72f4EuuStk8eLwUG0BS2m/TllTl9G3x2P7/AnyuixQ47vVKA== X-Received: by 10.200.22.142 with SMTP id r14mr7933777qtj.279.1505923580615; Wed, 20 Sep 2017 09:06:20 -0700 (PDT) Received: from logos.localdomain (pool-173-67-36-61.bltmmd.fios.verizon.net. [173.67.36.61]) by smtp.gmail.com with ESMTPSA id g15sm1517964qtk.47.2017.09.20.09.06.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Sep 2017 09:06:18 -0700 (PDT) Date: Wed, 20 Sep 2017 12:06:18 -0400 From: Mark Oteiza To: Eli Zaretskii Subject: Re: bug#28340: 26.0.50; xterm frame titles Message-ID: <20170920160618.wf37ddonfmeblntm@logos.localdomain> References: <87h8wjo44r.fsf@holos> <83mv6b2j4l.fsf@gnu.org> <20170912012122.GA11282@holos.localdomain> <83poalg6b5.fsf@gnu.org> <20170920122351.wx43g7m72xyxc37w@logos.localdomain> <83k20tfpmd.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83k20tfpmd.fsf@gnu.org> User-Agent: NeoMutt/20170912-13-728bb5 X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 28340-done Cc: 28340-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) On 20/09/17 at 01:47pm, Eli Zaretskii wrote: > > Date: Wed, 20 Sep 2017 08:23:51 -0400 > > From: Mark Oteiza > > Cc: 28340@debbugs.gnu.org > > > > > What about window-configuration-change-hook, does that help? You > > > could set some flag in after-make-frame-functions, and then test and > > > reset that flag in window-configuration-change-hook, when you see that > > > a buffer is switched in the frame. Would that work? > > > > This appears to work, thank you. Please see attached. > > Thanks, this LGTM. It needs a NEWS entry about the new defcustom, and > then it can go in. Thanks. Done, pushed as 3a09343e ------------=_1505923623-21102-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 3 Sep 2017 21:37:51 +0000 Received: from localhost ([127.0.0.1]:46983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1docaV-0008Gx-AB for submit@debbugs.gnu.org; Sun, 03 Sep 2017 17:37:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1docaS-0008Gj-HP for submit@debbugs.gnu.org; Sun, 03 Sep 2017 17:37:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1docaI-00017Q-9A for submit@debbugs.gnu.org; Sun, 03 Sep 2017 17:37:42 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46436) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1docaI-00017J-5M for submit@debbugs.gnu.org; Sun, 03 Sep 2017 17:37:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1docaD-0000pN-9I for bug-gnu-emacs@gnu.org; Sun, 03 Sep 2017 17:37:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1doca8-00013P-KT for bug-gnu-emacs@gnu.org; Sun, 03 Sep 2017 17:37:33 -0400 Received: from mail-qk0-x231.google.com ([2607:f8b0:400d:c09::231]:35510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1doca8-00012B-FB for bug-gnu-emacs@gnu.org; Sun, 03 Sep 2017 17:37:28 -0400 Received: by mail-qk0-x231.google.com with SMTP id p67so16533617qkd.2 for ; Sun, 03 Sep 2017 14:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version; bh=3kCh7BcrzwMP7JWLMs5fcHzSEvLE5EROLhkHRLusjXs=; b=dsyP/8vVQFQZrGv4bIHzPLlJTMOH4iJdVJgr57Iu+Gjb8vR59uY9qFkVZAjQiGUWtu 9x1PjJnZEmhctmiTnPYiznIzgtjKPREm/enS6tHLwE1gWSrKyXom2gWDB95svn9sfDlB GSs3EjPRXzNrBDw+U7OAsgEkL93NIpPeBwJzxpxLJi/68piLlTWzotLD/TnwHdhOeBI3 LOLGLLeWLKpDBEWsgDQGoraZeMqf885XUWnE8dzM0B3ilde6bMmqrQ7a7DH8zr7sT/zz Hi0OBuf+OGL8GVnrRnpFBVwopcl9k6yQme7HRTdG4W2sOO1EwOJZFAoL60mnGan7OPIz AW/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=3kCh7BcrzwMP7JWLMs5fcHzSEvLE5EROLhkHRLusjXs=; b=Pgtlp3DWzv15oZ7KoqoNJJsyUo2Fj/08Y39PlHbjJrAzs3B4+VwviDBfDDpH7GqNpJ BxVQWUfT0iGY3rEH/gTGSLNNAn8MajUNb7Qbu+hDOETEa9DyNL5Wzv8+pONs/3S8J4yQ tRzRbs3zVkFlwtX9dG1gm6CmK8HYrOjr54U1ZDOKX8vhv5zsPsl2XEM8KzjOwMWmwxG0 ayKGnsMlR62nVApICoJALax2ulYVSkbJhItb8fHY7QsGyXjfjQKTCsj9Zo4N5sxAjKb6 GnqxeBsTXBVxM/JDkcJbYdKXLL6kc2QH88UP3y+BWKaO/a6jehCYUh6Sdga3EplvpPx2 5dzQ== X-Gm-Message-State: AHPjjUjHjJF4lIufcpiYmFhher52z6uiPwh7lTSziJcnGdA2Tgp0TYMV EI9mo5iFnqZTN1kC6hmXSg== X-Google-Smtp-Source: ADKCNb4GuKMy7i6oCrMmBbbsxFYE4go69ebk5/t1Ar4/MyMl3YYr52YOwgM2vq7NbuPFQpfrQzCTCw== X-Received: by 10.55.70.75 with SMTP id t72mr10965435qka.14.1504474646359; Sun, 03 Sep 2017 14:37:26 -0700 (PDT) Received: from holos.localdomain (pool-173-64-88-95.bltmmd.fios.verizon.net. [173.64.88.95]) by smtp.gmail.com with ESMTPSA id j129sm2756419qkd.92.2017.09.03.14.37.25 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Sep 2017 14:37:25 -0700 (PDT) Received: by holos.localdomain (Postfix, from userid 1000) id AC46666207; Sun, 3 Sep 2017 17:37:24 -0400 (EDT) From: Mark Oteiza To: bug-gnu-emacs@gnu.org Subject: 26.0.50; xterm frame titles Date: Sun, 03 Sep 2017 17:37:24 -0400 Message-ID: <87h8wjo44r.fsf@holos> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.4 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.4 (----) Wishlist item. Hi, I tacked setting window/iconified window titles into term/xterm.el, but found a quirk I suspect is related to Bug#18137 (which refers to 42fe2e88d and Bug#15025). Because clients don't always have focus, opening a new client won't trigger hooks that I would think trigger, perhaps even after-make-frame-functions or window-size-change-functions. diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index e6d224dd3d..03dd516ebf 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -802,6 +802,7 @@ terminal-init-xterm (when (memq 'setSelection xterm-extra-capabilities) (xterm--init-activate-set-selection))) + (xterm--init-frame-title) ;; Unconditionally enable bracketed paste mode: terminals that don't ;; support it just ignore the sequence. (xterm--init-bracketed-paste-mode) @@ -828,6 +829,22 @@ xterm--init-activate-set-selection "Terminal initialization for `gui-set-selection'." (set-terminal-parameter nil 'xterm--set-selection t)) +(defun xterm--init-frame-title () + "Terminal initialization for `gui-set-selection'." + (xterm-set-window-title) + (add-hook 'post-command-hook 'xterm-set-window-title) + (add-hook 'minibuffer-exit-hook 'xterm-set-window-title)) + +(defun xterm-set-window-title () + "Set the window title of the Xterm with the current Emacs frame." + (send-string-to-terminal + (format "\e]2;%s\a" (format-mode-line frame-title-format)))) + +(defun xterm-set-icon-title () + "Set the window title of the Xterm with the current Emacs frame." + (send-string-to-terminal + (format "\e]1;%s\a" (format-mode-line icon-title-format)))) + (defun xterm--selection-char (type) (pcase type ('PRIMARY "p") ------------=_1505923623-21102-1--