@@ -435,7 +435,8 @@ before calling the format's serialize helper.")
435435 (agent-shell-queue-store-items agent-shell-queue--store)))
436436
437437(defun agent-shell-queue-unpause-all-sessions ()
438- "Clear the per-session pause list, resuming all individually paused sessions."
438+ "Clear the per-session pause list, resuming all individually paused sessions.
439+ When the global queue is also paused, prompts to resume it as well."
439440 (interactive)
440441 (setf (agent-shell-queue-queue-session-paused agent-shell-queue--queue) nil)
441442 (seq-do (lambda (item)
@@ -445,7 +446,9 @@ before calling the format's serialize helper.")
445446 (agent-shell-queue--save)
446447 (message "agent-shell-queue: all session pauses cleared")
447448 (agent-shell-queue--refresh-buffer)
448- (unless (agent-shell-queue-queue-paused agent-shell-queue--queue)
449+ (if (agent-shell-queue-queue-paused agent-shell-queue--queue)
450+ (when (y-or-n-p "Global queue is paused; resume it too? ")
451+ (agent-shell-queue-resume))
449452 (seq-do (lambda (bucket)
450453 (when-let* ((buf (get-buffer (car bucket)))
451454 (_ (buffer-live-p buf)))
@@ -3006,6 +3009,12 @@ and the queue advances to the next item."
30063009 :annotation "Remove background task flag"
30073010 :if (lambda () (and (not (memq (agent-shell-queue--iv-status) '(done running aborted)))
30083011 (agent-shell-queue--iv-bg-p))))
3012+ (list :key "O"
3013+ :label "Open shell buffer"
3014+ :cmd 'agent-shell-queue-item-view-open-shell
3015+ :group "Manage Task"
3016+ :annotation "Switch to this item's target shell buffer"
3017+ :if nil)
30093018 (list :key "i"
30103019 :label "Inspect raw"
30113020 :cmd 'agent-shell-queue-item-view-inspect
@@ -4040,6 +4049,24 @@ function, offer to create a new buffer of the same type."
40404049 (pop-to-buffer new-buf)))
40414050 (user-error "Shell buffer %s is not live" buf-name)))))
40424051
4052+ (defun agent-shell-queue-item-view-open-shell ()
4053+ "Switch to the shell buffer for the item shown in this view.
4054+ If the buffer is not live and the item's executor provides a create
4055+ function, offer to create a new buffer of the same type."
4056+ (interactive)
4057+ (when-let* ((buf-name (agent-shell-queue--iv-target)))
4058+ (if-let* ((buf (get-buffer buf-name)))
4059+ (pop-to-buffer buf)
4060+ (if-let* ((item (agent-shell-queue--iv-item))
4061+ (executor-fn (agent-shell-queue-item-executor item))
4062+ (executor-name (agent-shell-queue--executor-name executor-fn))
4063+ (entry (agent-shell-queue--find-executor executor-name))
4064+ (create-fn (agent-shell-queue-executor-create entry)))
4065+ (when (y-or-n-p (format "Buffer %s is not live. Create a new one? " buf-name))
4066+ (when-let* ((new-buf (funcall create-fn)))
4067+ (pop-to-buffer new-buf)))
4068+ (user-error "Shell buffer %s is not live" buf-name)))))
4069+
40434070;;;###autoload
40444071(defun agent-shell-queue-capture (&optional buf)
40454072 "Open a capture buffer targeting BUF (nil adds to the unassigned queue).
@@ -4204,7 +4231,9 @@ format switch. Changes take effect immediately via `agent-shell-queue-buffer-re
42044231 :if (lambda () (and (agent-shell-queue--point-editable-p)
42054232 (agent-shell-queue--point-bg-p))))
42064233 ("C-d" "Destructive…" agent-shell-queue-destructive-menu
4207- :if agent-shell-queue--point-not-running-p)]
4234+ :if agent-shell-queue--point-not-running-p)
4235+ ("O" "Open shell for item at point" agent-shell-queue-buffer-open-shell
4236+ :if agent-shell-queue--point-item)]
42084237 ["Move / Assign" :if agent-shell-queue--point-editable-p
42094238 ("M-<up>" "Move up" agent-shell-queue-buffer-move-up
42104239 :if agent-shell-queue--point-editable-p)
@@ -4241,8 +4270,6 @@ format switch. Changes take effect immediately via `agent-shell-queue-buffer-re
42414270 ("v" "Export scope to YAML" agent-shell-queue-export)
42424271 ("F" "Flush to disk" agent-shell-queue-flush)
42434272 ("D" "Show disk state" agent-shell-queue-show-disk-state)
4244- ("O" "Open shell for item at point" agent-shell-queue-buffer-open-shell
4245- :if agent-shell-queue--point-item)
42464273 ("=" "Inspect item raw…" agent-shell-queue-buffer-inspect-item
42474274 :if agent-shell-queue--point-item)]
42484275 ["Display"
0 commit comments