Basically, I would like GUI emacs to replicate the terminal behavior, where a new frame is opened within the same (OS) window. This would work similar to vim's tabs, which are just a way to move around different window configurations within the same session.

  • 2
    To make sure everyone is using the terms the same way, have a look at What's the difference between a buffer, a file, a window, and a frame?
    – Dan
    May 15, 2016 at 23:40
  • elscreen is the tabbar-looking minor-mode that switches window configurations. I had to do some tweaking to the source-code that I used a while back to get everything working just right, so I'll let someone else provide the best fork/link for it.
    – lawlist
    May 16, 2016 at 1:44

1 Answer 1


In emacs, a frame is always a separate graphical window (and as you know, in emacs the frame is divided into windows, making the terminology somewhat confusing).

However, you can save window configurations to registers, and restore them later; see the "Configuration Registers" page of the emacs manual (M-: (info "(emacs)Configuration Registers")).

There are a number of emacs packages which give you a tab bar, such as TabBarMode, but I'm not aware of any off-hand where the tab buttons switch window layouts, rather than which buffer is visible. Maybe you can find one, or you could modify one to do it.

Another option is to do this not in emacs, but in your window manager. i3, for instance, can stack windows into a tabbed container.

  • db48x: The question terminology is pretty much fine. When Emacs is run in a terminal, frames work as described in the question -- opening a new frame (C-x 5 2) 'replaces' the frame displayed in the terminal, as does switching between existing frames (C-x 5 o). iDontKnowBetter is asking how to get the same experience in GUI Emacs.
    – phils
    May 16, 2016 at 5:28
  • 1
    I understand, but making a new frame while running in a window manager (as opposed to a terminal) always puts the frame in a new gui window. This isn't configurable, and if you hack make-frame so that it always calls tty-create-frame-with-faces then you get an error because you're not in a tty. This is implemented in C, and internally it calls the C function make_frame. It's not exposed to elisp, but even if it were it intermingles all of the X and GTK operations needed to make a new gui window for the frame.
    – db48x
    May 16, 2016 at 7:41
  • 1
    Oh, and the brief discussion of terminology is not because of confusion on the part of anyone here; it's for the benefit of future readers. Howdy folks!
    – db48x
    May 16, 2016 at 7:43
  • 1
    Ah, I see :) I think the details of your first comment would make a very helpful edit to the body of your answer, as that addresses the question directly.
    – phils
    May 16, 2016 at 9:01

Your Answer

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

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