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

From: Mark Oteiza <[email-masked]>
Date: Tue, 26 Sep 2017 00:08:08 -0400

On 26/09/17 at 12:45am, Katsumi Yamaoka wrote:
> On Mon, 25 Sep 2017 13:24:24 -0400, Mark Oteiza wrote:
> > Mark Oteiza <[email-masked]> writes:
> 
> >> Katsumi Yamaoka <[email-masked]> writes:
> 
> >>> The feature looks nice but I want the original title to come back
> >>> when Emacs exits or suspends (even if it launches with -Q).
> 
> >> I posted a patch here
> >> https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00728.html
> 
> >> but at the moment it's not clear to me how to handle other terminals
> >> that use an xterm- family terminfo.
> 
> I use:
> 
> $ xterm -v
> XTerm(327)
> 
> $ xterm&
> Then the title bar of the launched xterm shows "xterm".
> 
> > 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.