Persist active agent-shell sessions with Emacs Desktop.
This package saves active agent-shell-mode buffers into the normal Desktop
state and restores them with the same agent config, working directory, session
ID, and buffer name on the next Emacs startup.
- Emacs 29.1 or newer
agent-shell0.50.1 or newerdesktop, which ships with Emacs
This package uses internal agent-shell APIs because Agent Shell does not
currently expose a public Desktop restore entry point. Specifically
agent-shell--stateto get the session id and agent-config idagent-shell--startbecause the public API does not allow launching the shell without it taking focus
With package-vc-install:
(package-vc-install
'(agent-shell-desktop
:url "https://github.com/timfel/agent-shell-desktop.el"))With use-package and package-vc:
(use-package agent-shell-desktop
:vc (:url "https://github.com/timfel/agent-shell-desktop.el")
:after (agent-shell desktop)
:config
(agent-shell-desktop-mode 1))Manual installation:
(add-to-list 'load-path "/path/to/agent-shell-desktop.el")
(require 'agent-shell-desktop)
(agent-shell-desktop-mode 1)Load and enable agent-shell-desktop-mode before Desktop restores buffers:
(require 'agent-shell)
(require 'agent-shell-desktop)
(agent-shell-desktop-mode 1)
(desktop-save-mode 1)Only Agent Shell buffers with an active session ID are saved. Deferred sessions that have not been initialized yet are skipped.
Run tests against a local Agent Shell checkout:
make test AGENT_SHELL_DIR=/path/to/agent-shellByte-compile the package:
make compile AGENT_SHELL_DIR=/path/to/agent-shellGPL-3.0-or-later. See LICENSE.