Skip to content

Commit 6ada803

Browse files
tychoishclaude
andcommitted
feat: add enable/disable intercept-mode commands and promote toggle to Queue control
Add agent-shell-queue-enable-intercept-mode and agent-shell-queue-disable-intercept-mode as explicit one-way commands alongside the existing toggle. Move the toggle entry from the "Scope / Export" section to "Queue control" where it sits with the session-level lp/lR bindings under the l prefix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4a11cf3 commit 6ada803

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

agent-shell-queue.el

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,28 @@ Installed as :before advice on `shell-maker-submit'."
377377
(buffer-name buf))
378378
(agent-shell-queue--refresh-buffer))))
379379

380+
(defun agent-shell-queue-enable-intercept-mode (&optional buf)
381+
"Enable intercept mode in BUF so user-typed turns are captured as queue items."
382+
(interactive
383+
(list (or (and (derived-mode-p 'agent-shell-mode) (current-buffer))
384+
(agent-shell-queue--pick-buffer "Enable intercept for: "))))
385+
(when buf
386+
(with-current-buffer buf
387+
(setq agent-shell-queue-intercept-mode t)
388+
(message "agent-shell-queue intercept: ENABLED in %s" (buffer-name buf))
389+
(agent-shell-queue--refresh-buffer))))
390+
391+
(defun agent-shell-queue-disable-intercept-mode (&optional buf)
392+
"Disable intercept mode in BUF."
393+
(interactive
394+
(list (or (and (derived-mode-p 'agent-shell-mode) (current-buffer))
395+
(agent-shell-queue--pick-buffer "Disable intercept for: "))))
396+
(when buf
397+
(with-current-buffer buf
398+
(setq agent-shell-queue-intercept-mode nil)
399+
(message "agent-shell-queue intercept: disabled in %s" (buffer-name buf))
400+
(agent-shell-queue--refresh-buffer))))
401+
380402
(defun agent-shell-queue--default-state-file ()
381403
"Default queue state file path under `user-emacs-directory'."
382404
(expand-file-name (concat "agent-shell-queue."
@@ -3259,6 +3281,7 @@ format switch. Changes take effect immediately via `agent-shell-queue-buffer-re
32593281
("R" "Resume (global)" agent-shell-queue-resume)
32603282
("lp" "Pause (session)" agent-shell-queue-session-pause)
32613283
("lR" "Resume (session)" agent-shell-queue-session-resume)
3284+
("li" "Toggle intercept mode" agent-shell-queue-toggle-intercept-mode)
32623285
("U" "Resume all sessions" agent-shell-queue-unpause-all-sessions)]
32633286
["Manage Task" :if agent-shell-queue--point-item
32643287
("s" "Dispatch now" agent-shell-queue-buffer-send
@@ -3318,7 +3341,6 @@ format switch. Changes take effect immediately via `agent-shell-queue-buffer-re
33183341
("N" "Set scope (narrow)" agent-shell-queue-set-scope)
33193342
("W" "Widen to global scope" agent-shell-queue-scope-global)
33203343
("v" "Export scope to YAML" agent-shell-queue-export)
3321-
("li" "Toggle intercept mode" agent-shell-queue-toggle-intercept-mode)
33223344
("F" "Flush to disk" agent-shell-queue-flush)
33233345
("D" "Show disk state" agent-shell-queue-show-disk-state)
33243346
("O" "Open shell for item at point" agent-shell-queue-buffer-open-shell

0 commit comments

Comments
 (0)