-
-
Notifications
You must be signed in to change notification settings - Fork 88
Description
Problem
In Doom Emacs, agent-shell buffers get skipped by switch-to-prev-buffer when quitting other buffers (like org-agenda). After pressing q to quit the agenda, instead of returning to the agent-shell buffer, Emacs switches to a different buffer.
Cause
Doom Emacs filters "unreal" buffers from buffer switching via a frame buffer-predicate. Agent-shell buffers are considered "unreal" because they don't visit files (triggers doom-non-file-visiting-buffer-p).
Fix
Setting doom-real-buffer-p buffer-locally to t marks agent-shell buffers as first-class citizens:
(add-hook 'agent-shell-mode-hook
(lambda ()
(setq-local doom-real-buffer-p t)))Question
Should this be added to agent-shell itself? Options:
-
Add to agent-shell.el with a
boundpcheck:(when (boundp 'doom-real-buffer-p) (setq-local doom-real-buffer-p t))
-
Document in README as a recommended config for Doom users
-
Add via mode hook in agent-shell.el:
(add-hook 'agent-shell-mode-hook (lambda () (when (boundp 'doom-real-buffer-p) (setq-local doom-real-buffer-p t))))
I have a branch with option 1 ready if you'd prefer that approach.
Written by Claude