0

I'm using ConEmu to run emacs (text-based) in a tab. I'd like to have the frame title appear in the Window Title Bar much in the same way my PowerShell prompt does.

Has anyone gotten this to work? The standard ways of setting the frame title have not proved fruitful yet.

Thanks, Larry

EDIT - screenshots added

Pre-buffer eval:

Post-buffer eval and screen refresh:

6
  • Don't know how emacs works. Is your frame title configurable? If so, you can use ANSI or GuiMacro to change tab out console title.
    – Maximus
    Jan 23, 2014 at 22:27
  • maximus - the frame title is configurable in emacs, as shown by @ThingOutsideTheBun, but i'm still having some issues. GUIMacro may be too complex. Jan 24, 2014 at 18:38
  • 1
    I believe, ThingOutsideTheBun shows right way to go. Thought, no need to send "\033]1;" but "\033]2;" is OK, it must change the window title. Also, you may use concat "\033]9;3;" (yourtext) "\007" to change tab title only.
    – Maximus
    Jan 24, 2014 at 21:37
  • @Maximus - no change....did the same thing Jan 27, 2014 at 13:49
  • Wondering, why you not to describe what is ruined and what is not working?
    – Maximus
    Jan 27, 2014 at 17:19

1 Answer 1

2

Add the following lines to your emacs start-up file ($HOME/.emacs or $HOME/.emacs.d/init.el) and then reload it.

;; for buffer name to show in the term title
(defun xterm-title-update ()
  (interactive)
  (send-string-to-terminal (concat "\033]1; " (buffer-name) "\007"))
  (if buffer-file-name
      (send-string-to-terminal (concat "\033]2; " (buffer-file-name) "\007"))
    (send-string-to-terminal (concat "\033]2; " (buffer-name) "\007"))))
;;
(if (not window-system)
    (add-hook 'post-command-hook 'xterm-title-update))
5
  • partially worked. it changed the frame title, but ruined the formatting in the rest of the emacs window. i'm still trying. thanks. Jan 24, 2014 at 18:37
  • @larry - can you explain what is ruined? Jan 28, 2014 at 22:39
  • See screen shots that were added to the original question Jan 29, 2014 at 2:04
  • Sorry I still don't get it. Based on those two pictures above, could you describe in words what is not working. Also, it looks like you are using the native Windows version of emacs. Jan 29, 2014 at 3:04
  • I'm running emacs as downloaded from gnu.spinellicreations.com/emacs/windows. As for the differences, the first window, prior to evaluating the buffer, I have colors, bars, etc. After evaluating the elisp code, I lose "decoration" and proper window refreshes. Jan 30, 2014 at 20:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .