Adicione as seguintes linhas ao seu arquivo de inicialização do emacs ($ HOME / .emacs ou $ HOME / .emacs.d / init.el) e recarregue-o.
;; for buffer name to show in the term title
(defun xterm-title-update ()
(interactive)
(send-string-to-terminal (concat "3]1; " (buffer-name) ";; for buffer name to show in the term title
(defun xterm-title-update ()
(interactive)
(send-string-to-terminal (concat "3]1; " (buffer-name) "%pre%7"))
(if buffer-file-name
(send-string-to-terminal (concat "3]2; " (buffer-file-name) "%pre%7"))
(send-string-to-terminal (concat "3]2; " (buffer-name) "%pre%7"))))
;;
(if (not window-system)
(add-hook 'post-command-hook 'xterm-title-update))
7"))
(if buffer-file-name
(send-string-to-terminal (concat "3]2; " (buffer-file-name) "%pre%7"))
(send-string-to-terminal (concat "3]2; " (buffer-name) "%pre%7"))))
;;
(if (not window-system)
(add-hook 'post-command-hook 'xterm-title-update))