On Ubuntu, I usually open more than one Emacs instances in the same time (for frontend and back development). These instances always by default take the name "Terminal" as a title as shown on this screenshot:

enter image description here

Is there a handy way to change that title?

Emacs is running inside a Gnome terminal.

  • 1
    See also emacs.stackexchange.com/questions/41309/…
    – andrej
    Dec 24, 2018 at 8:52
  • 1
    @andrej can you add these as an answer to your question?
    – user12563
    Dec 24, 2018 at 11:30
  • 1
    @BillalBegueradj Is this what we see in the screenshot emacs in the Terminal? Then emacs doesn't seem to be the right place to look at. Then this askubuntu.com/questions/636944/… seems to be more relevant.
    – andrej
    Dec 24, 2018 at 14:04
  • 1
    @andrej You might still want to have Emacs set the terminal title, for example to show the current file name. Dec 24, 2018 at 14:30
  • 2
    Why not run a GUI Emacs? More things work out of the box with a GUI Emacs, including the window title. Dec 24, 2018 at 14:30

2 Answers 2


A bit of terminology that can help you find help and documentation: for historical reasons, what the rest of the world calls a window is called frame in Emacs. What Emacs calls a window is what the rest of the world sometimes calls a pane. The same metaphor grew in different directions.

Emacs automatically sets its operating system window title (i.e. the title of the Emacs frame) to emacs@darkstar (where darkstar is the host name of the machine it's runnning on) if there's a single Emacs window, and to the buffer name if there are multiple windows. (That's multiple windows in the same instance.) However, this only applies to the title of Emacs windows, i.e. when running a GUI instance of Emacs. If you run Emacs inside a terminal, Emacs doesn't set the terminal's title out of the box.

The Emacs wiki gives a solution when Emacs is running in an xterm-like terminal. Most Unix terminal emulators, including Gnome Terminal, are xterm-like. Install the packages xterm-frobs.el and xterm-title.el (not available from a package repository that I can find) and put the following code in your init file:

(require 'xterm-title)
(xterm-title-mode 1)

Then when Emacs is running in a terminal, it will try to set the terminal emulator's title.

To configure the text that goes into the title, configure the variable frame-title-format. For example, to always show Emacs: buffer name regardless of whether there are multiple frames, use

(setq frame-title-format "Emacs: %b")

If you want to give a specific title to a specific window, use the command set-frame-name.

  • On emacs 28.0.50 and Ubuntu 19.10, xterm-title-mode appears to block until you C-g, and doesn't change the title. Mar 29, 2020 at 20:49

xterm-title doesn't work on Emacs 28, and has been removed from MELPA due to being unmaintained and served over insecure HTTP.

I created a simple replacement:


  • If using term-title, how does one restore the old terminal title after quitting Emacs?
    – sam
    Jul 18, 2023 at 2:53
  • The simple terminal protocol used by term-title does not allow querying the title, only setting it. The pragmatic solution is to let your shell set the title to what makes sense at the time, such as the current working directory. Jul 18, 2023 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.