From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Knut Anders Hatlen Newsgroups: gmane.emacs.bugs Subject: bug#49932: 28.0.50; Error in GUI frames when xterm-set-window-title is set Date: Mon, 09 Aug 2021 20:39:25 +0200 Message-ID: <875ywe5uoy.fsf@gmail.com> References: <87im0h0xgh.fsf@dell.mail-host-address-is-not-set> <87wnou3f92.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37009"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 49932@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 09 20:40:09 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mDAC1-0009Ru-1A for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Aug 2021 20:40:09 +0200 Original-Received: from localhost ([::1]:36380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDAC0-0001AW-0H for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 Aug 2021 14:40:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDABu-00018u-82 for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 14:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46218) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDABu-0006m2-0x for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 14:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mDABt-0003Yt-Rf for bug-gnu-emacs@gnu.org; Mon, 09 Aug 2021 14:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Knut Anders Hatlen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Aug 2021 18:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49932 X-GNU-PR-Package: emacs Original-Received: via spool by 49932-submit@debbugs.gnu.org id=B49932.162853437713651 (code B ref 49932); Mon, 09 Aug 2021 18:40:01 +0000 Original-Received: (at 49932) by debbugs.gnu.org; 9 Aug 2021 18:39:37 +0000 Original-Received: from localhost ([127.0.0.1]:57764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDABU-0003Y5-OE for submit@debbugs.gnu.org; Mon, 09 Aug 2021 14:39:37 -0400 Original-Received: from mail-lf1-f45.google.com ([209.85.167.45]:35638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDABR-0003Xn-TQ for 49932@debbugs.gnu.org; Mon, 09 Aug 2021 14:39:35 -0400 Original-Received: by mail-lf1-f45.google.com with SMTP id c16so35975902lfc.2 for <49932@debbugs.gnu.org>; Mon, 09 Aug 2021 11:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=dIYvPthijM6e8x6BxFiiUYG+tBAwjJNTkXrvEaTT/Xc=; b=lq1uGx9rfaoKMLFLuMcwWWMwOLRJqZ0/3FFUVybh6NnKmlNgfs9K3w2tum0nmRc/VT ZKtu1MmIzodaIWQQH8jFX35ncZc2WASPPicC49vlxG5KfmDGnLb0q/Etnv0IBdvmGJFV cj5c2eJE36b7Le1tPRX3w5e3NEQtYHaPi37Vh0aWa//I/+vrKJF6iF5WhFdejPZHompx ef5mkpDco7MHGJlz8wtAUSC7H2GO6QPXV37fnuOrd4fss1jOl7P4JhgddWdkcDyhviUb tmHWt3XF/FgxXzyMaF++v6bDHm4yFaAcsWxCgkk7XhGGUw0ZRTuQEzIObuDU2IIFgesY 3tYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=dIYvPthijM6e8x6BxFiiUYG+tBAwjJNTkXrvEaTT/Xc=; b=Ep4HjIqeUL4RjefhJpz28jfJl+lp/DWVPCgrW6jVHqIqzmlCei0PcEcWLKeZUmFQlX ZMh1uN9WRNlGwdbs5Suvg5Qu5nFdLhck08VI2j9ZB5W7kJcfjZWFb8FVNvHxAHiLFzLy Oquw7CWR4OvL5HcO4ZFYhiCTyeA16g7gBzwOKcBxhMHl35d0ZP079Sk6lcFcaWu8kOmP nrKN4DOkky3PNMbsLPH975ReXA8JRnQOvzouslvnlP2DGRdybA5cmf4temK0EGjXc0IO GsH5M3XUuGA27m9dEm1PGFBcn25vxMIMxr7TTEevsLTzS2KNl7K+1mUl+/wyuy51kK7Q nk+g== X-Gm-Message-State: AOAM533Lx4WDKefWjGyVh78kxJCoU2lVXVQvu71Qv3WLkcYBaER940je kUsU080r8OnFLbqdx80vNrxqqsyxiQ== X-Google-Smtp-Source: ABdhPJx3ZmpFQvUx6QlYDHU7GfSrhQwclHqwKlWc1Cxv+/tfnHDd4yBZ/5wa/zwwlSZzphnvsT+Oow== X-Received: by 2002:ac2:5192:: with SMTP id u18mr18286671lfi.527.1628534367313; Mon, 09 Aug 2021 11:39:27 -0700 (PDT) Original-Received: from dell ([2a02:1660:692e:dd00::44c]) by smtp.gmail.com with ESMTPSA id 4sm1630627ljf.127.2021.08.09.11.39.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 11:39:26 -0700 (PDT) In-Reply-To: <87wnou3f92.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 09 Aug 2021 15:43:37 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:211460 Archived-At: Lars Ingebrigtsen writes: > Knut Anders Hatlen writes: > >> 5. Start a new GUI frame with 'emacsclient -c', and again observe that >> "Device 1 is not a termcap terminal device" is reported. >> >> I believe xterm-set-window-title should not affect GUI frames. > > The problem seems to be: > > (defun xterm-set-window-title (&optional terminal) > "Set the window title of the Xterm TERMINAL. > The title is constructed from `frame-title-format'." > (send-string-to-terminal > (format "\e]2;%s\a" (format-mode-line frame-title-format)) > terminal)) > > Debugger entered: nil > xterm-set-window-title() > xterm--init-frame-title() > xterm--init() > terminal-init-xterm() > tty-run-terminal-initialization(# nil t) > tty-create-frame-with-faces(((client . #>) (environment "_=./$ > #f(compiled-function (params) #)(((client . # apply(#f(compiled-function (params) #) ((client . #$ > frame-creation-function(((client . #>) (environment "_=./li > > That is, it's not specifying what terminal to set the title in -- so > it's set in all terminals, no matter what, all the time? That is: > > (add-hook 'post-command-hook 'xterm-set-window-title) > (add-hook 'minibuffer-exit-hook 'xterm-set-window-title)) > > Which just seems less than optimal in many ways -- running this from > post-command-hook seems pretty excessive? But... > > Anyway, I've now just made the function not do anything on graphical > displays, which should make the problem go away, but perhaps this should > be implemented a different way? Thanks for the quick fix, Lars. I guess you're right that it's not ideal. Some kind of generic set-frame-title mechanism that both graphical frames and tty frames could hook into sounds better. (I don't know the code well enough to suggest anything concrete. And I haven't had xterm-set-window-title enabled long enough to have noticed other problems with the current approach.) But in any case your patch seems to fix the immediate problem, so thanks for that. -- Knut Anders