fix(tty): xterm-set-window-title in GUI emacs

This was fixed in Emacs 28.0.91, but the advice will remain for 27
users. At least until we drop support for it.

Fix: #4977
Ref: emacs-mirror/emacs@89d02841ab
This commit is contained in:
Henrik Lissner 2022-02-10 19:30:37 +01:00
parent 2a7eee556f
commit 99ecc264f7

View file

@ -3,9 +3,10 @@
;; Keep window title up-to-date; should fail gracefully in non-xterm terminals. ;; Keep window title up-to-date; should fail gracefully in non-xterm terminals.
;; Only works in Emacs 27+. ;; Only works in Emacs 27+.
(setq xterm-set-window-title t) (setq xterm-set-window-title t)
;; DEPRECATED Not needed on Emacs 28+. Remove when dropping 27 support.
(defadvice! +tty--only-set-window-title-in-tty-a (&optional terminal) (defadvice! +tty--only-set-window-title-in-tty-a (&optional terminal)
"`xterm-set-window-title' fails in GUI Emacs. Stop that. Get some help." "`xterm-set-window-title' fails in GUI Emacs. Stop that. Get some help."
:before-until #'xterm-set-window-title :before-while #'xterm-set-window-title
(not (display-graphic-p terminal))) (not (display-graphic-p terminal)))
;; Some terminals offer two different cursors: a "visible" static cursor and a ;; Some terminals offer two different cursors: a "visible" static cursor and a