Subject: bug#28591: 27.0.50; xterm-set-window-title

From: Mark Oteiza <[email-masked]>
Date: Fri, 29 Sep 2017 07:57:00 -0400

On 29/09/17 at 01:45pm, Eli Zaretskii wrote:
> > Date: Tue, 26 Sep 2017 00:08:08 -0400
> > From: Mark Oteiza <[email-masked]>
> > Cc: [email-masked]
> > 
> > > > The following lightly tested patch appears to do the right thing here.
> > > 
> > > Thanks.  I tried.  But nothing seems to be changed unfortunately.
> > > When I run `emacs -nw' in the xterm, the title becomes to
> > > "emacs@hostname" but the original title "xterm" is not pushed to
> > > the `xterm-window-title-stack' variable.  And the title does not
> > > come back to "xterm" when I exit or suspend Emacs -nw.
> > > 
> > > I tried adding `(error "XXX")' to the `xterm--title-handler'
> > > function but nothing happens (with no error).  So, the function
> > > doesn't seem to run by way of `xterm-push-title-stack'.
> > 
> > Grr, thanks.  I see what you're seeing in XTerm 330.  I am stumped--not
> > sure this is possible in Elisp, so I'm inclined to revert.
> 
> That'd be too drastic, I think.  The code did work for you, right?  So
> it definitely works for some configurations out there, and I think we
> could leave it in Emacs, turned off by default, and allow its optional
> activation with the proper warning that it might not work for some
> versions of xterm.

Everything except foregrounding a client works (I did not test this),
where the following occurs:

  Error in post-command-hook (xterm-set-window-title): (error "Terminal
  is currently suspended")

post-command-hook is used to catch changing windows within a frame--I
do not know if there is another hook (or event perhaps) that would
better serve this purpose.