Maybe a silly question: I'm using desktop for saving Emacs' sessions. I've set

(setq desktop-restore-frames t)
(desktop-save-mode 0)

So windows and frames state is supposed to be saved, and I'm saving and reading desktop files manually.

When I run Emacs in its own X window, and I do desktop-read or desktop-change-dir everything is fine - frames, buffers and windows (including window splitting) are restored (for example, if I split a window with C-x 2, then save the desktop, this state is restored).

However, when I run Emacs either in a terminal emulator or in a virtual terminal only buffers are restored - window splitting is not shown, and although, when loading a desktop file I see a message like "Desktop: 2 frames, 5 buffers restored." in the minibuffer, and I see "F1" in the mode line, nothing happen when I do, for example C-x 5 o (that is, other-frame).

Is this how it is supposed to work or am I missing something?

  • Welcome to Emacs SE. C-x 2 does not split the frame. It runs split-window-below. The analog for frames would be C-x 5 2, i.e., make-frame-command. To test whether multiple frames are present in an emacs on a text terminal you would have to type C-x 5 o for the command other-frame. Or maybe do M-: (frame-list) to get a list of current frames.
    – Tobias
    Apr 5, 2019 at 9:37
  • Thanks @Tobias. Perhaps I've used inaccurate terms. I edited my question to make it clearer. I did mean splitting a window.
    – amitr
    Apr 5, 2019 at 14:19
  • I can reproduce your problem with terminal Emacs 26.1 on Windows Subsystem 4 Linux (Ubuntu 18.04 LTS). As an add-on: Even with Desktop: 2 frames, 0 buffers restored. the answer to M-: (remove terminal-frame (frame-list)) is nil, i.e., there exists only the terminal-frame.
    – Tobias
    Apr 5, 2019 at 15:34
  • Your question has already an answer there.
    – Tobias
    Apr 5, 2019 at 16:31


Browse other questions tagged or ask your own question.