0

For session management, I was happy with inbuilt desktop.el except that it could not retain the term/shell buffers. Everytime I quit emacs, it asked to kill the term/shells. Then I read the ability of desktop+ to retain the term/shell, thus installed it through M-x package-install after going through its github doc. I removed the line desktop-save-mode from init file to stop loading the desktop.el sessions. Also, as suggested in the github page I have put

(setq desktop+-special-buffer-handlers '(term-mode compilation-mode org-agenda-mode indirect-buffer Man-mode shell-mode)) 

in the init file..

I have 2 questions

  1. In new emacs session (having term/shell windows), I saved the session with desktop+create, verified its existence on the disk, but when quitting emacs, in minibuffer, I still get the same message as with desktop (to kill the running processes i.e. the term/shell buffers). How can I retain the session term/shell windows as mentioned in the doc?

  2. Another question is that I need to desktop+load after opening emacs to load the session even of the default dir. What can I add in the init file to load the default session and not a blank emacs. I tried desktop+-save-mode 1 as implicitly mentioned in the github page but this gives as error loading the init file. Even puttting (require 'desktop+) does not load the saved session.

Before asking here, I opened an issue on the github, but it hasn't been answered yet.

7
  • 1
    What are you expecting to happen here? If you start processes inside Emacs and then kill Emacs, you will kill the inferior processes. The desktop.el library can't keep those processes running and then reattach them to a new Emacs session, any more than it could resurrect the original Emacs process. Commented May 9, 2023 at 7:57
  • 1
    From the looks of github.com/ffevotte/desktop-plus/commit/… the functionality is very limited. Commented May 9, 2023 at 7:57
  • 1
    I am expecting emacs to retain the term/shell windows at least. That's what desktop+ is stating in point no 2 Desktop sessions by default save only buffers associated to "real" files. Desktop+ extends this by handling also "special buffers". The list of currently supported special buffer types is: compilation buffers (in compilation-mode) terminal buffers (in term-mode) org agenda & todo lists (in org-agenda-mode) indirect buffers (a.k.a clones). man pages (in Man-mode) shell buffers (in shell-mode) Commented May 10, 2023 at 8:04
  • I am not expecting it to retain the running processes in the shell/term like tmux, as there is no running processes inside shell at the time of exiting emacs. emacs (or desktop.el) considers the idle term/shell buffers as running processes and asks to kill at the time of exiting. I am just expecting to save and reload the term/shell buffers (& its respective windows) as mentioned in the desktop+. Is there some other way to do that within emacs? Commented May 10, 2023 at 9:30
  • The link in my previous comment indicates that it won't save/restore buffer contents. Offhand I can't help with any alternatives, sorry (it's not something I've ever wanted to do), so hopefully someone else can make a suggestion. My best suggestion is to look at the desktop+ code and see if you can contribute an enhancement back which would do the things you want. Commented May 12, 2023 at 3:33

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.