]> code.delx.au - dotemacs/blobdiff - lisp/my-defuns.el
xterm frame title support
[dotemacs] / lisp / my-defuns.el
index db7c56f96334e203b8fa3d74055ff60abd49a03a..37d5c3e3bd33ea082c4c2c4534857c41375c8efc 100644 (file)
@@ -18,7 +18,7 @@
        ") - Emacs"
        )
     (concat
-     "%b"
+     (buffer-name)
      (if (buffer-modified-p)
          " +")
      " - Emacs")))
     (comment-or-uncomment-region (line-beginning-position) (line-end-position)))
   (forward-line))
 
+(defun my/terminal-update-title ()
+  "If using a terminal frame then sends the escape codes to update the title."
+  (if (eq 'terminal-init-xterm (terminal-parameter (frame-terminal) 'terminal-initted))
+      (send-string-to-terminal (concat "\033]0;" (my/generate-frame-title) "\007"))))
+
 (defun my/use-eslint-from-node-modules ()
   (let* ((root (locate-dominating-file
                 (or (buffer-file-name) default-directory)