Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9ec7092
Applying session list/load PR #263 by @travisjeffery
xenodium Feb 12, 2026
aa946f3
Rebase on to main to enable bootstrapping and session resume support
xenodium Feb 13, 2026
f66ff7e
Align session columns in session picker (completing-read)
xenodium Feb 13, 2026
0b7cea3
Migrate #263 away from :shell params
xenodium Feb 13, 2026
96fa53e
Use session list/delete/load ACP helpers as per @farra's PR #248
xenodium Feb 13, 2026
26eae7c
Fixing docstring warnings
xenodium Feb 13, 2026
56e76ee
Fixing misplaced paren in agent-shell-delete-session
xenodium Feb 13, 2026
c6f638e
Simplify session picker
xenodium Feb 13, 2026
6930406
Fixing indent
xenodium Feb 13, 2026
45f2e82
Identify acp-related vars/data and name accordingly
xenodium Feb 13, 2026
f6f3b74
Removing unnecessarily substring-no-properties
xenodium Feb 13, 2026
7b43f9c
Removing session-deletion code as not yet validated
xenodium Feb 13, 2026
6e4c4d2
Removing session-deletion code from agent-shell-delete-session too
xenodium Feb 13, 2026
cd7400c
Adds event subscriptions #62
xenodium Feb 14, 2026
534b119
Merge branch 'main' of github.com:xenodium/agent-shell
xenodium Feb 14, 2026
af68b70
Applying session list/load PR #263 by @travisjeffery
xenodium Feb 12, 2026
3dec641
Rebase on to main to enable bootstrapping and session resume support
xenodium Feb 13, 2026
beea09c
Align session columns in session picker (completing-read)
xenodium Feb 13, 2026
6dd6e2c
Migrate #263 away from :shell params
xenodium Feb 13, 2026
c3b6ff4
Use session list/delete/load ACP helpers as per @farra's PR #248
xenodium Feb 13, 2026
397981d
Fixing docstring warnings
xenodium Feb 13, 2026
b93126a
Fixing misplaced paren in agent-shell-delete-session
xenodium Feb 13, 2026
de3dc4b
Simplify session picker
xenodium Feb 13, 2026
0c63141
Fixing indent
xenodium Feb 13, 2026
cc5c1bc
Identify acp-related vars/data and name accordingly
xenodium Feb 13, 2026
7b0ed83
Removing unnecessarily substring-no-properties
xenodium Feb 13, 2026
6ad5a4c
Removing session-deletion code as not yet validated
xenodium Feb 13, 2026
9d5e3d0
Removing session-deletion code from agent-shell-delete-session too
xenodium Feb 13, 2026
a221a94
Merge branch 'pr263-resume-session' of github.com:xenodium/agent-shel…
xenodium Feb 14, 2026
4797504
Defer displaying new shell buffers until user picks a session
xenodium Feb 15, 2026
a0ec81c
Ensure Loading... message is handled in other cases
xenodium Feb 15, 2026
51f0ba2
Show project name in session picker
xenodium Feb 15, 2026
3b856f7
Improve session picker column alignment
xenodium Feb 15, 2026
55fd967
Fixing docstring warnings
xenodium Feb 15, 2026
1b1d82d
Make agent-shell-session-load-strategy default to new sessions
xenodium Feb 15, 2026
836635a
Fixing tests
xenodium Feb 15, 2026
00ed2b4
Improve session listing column alignment
xenodium Feb 15, 2026
d71d309
Render resumed user inputs as shell prompts
xenodium Feb 15, 2026
11176f9
Adds agent-shell-prefer-session-resume
xenodium Feb 15, 2026
41c45fa
Fixes duplicate sessions during bootstrapping
xenodium Feb 15, 2026
9e783f2
Display a "Resuming ression" fragment with status changes
xenodium Feb 15, 2026
ae7d8c2
Prevent shells from ever modifying an editable viewport
xenodium Feb 15, 2026
212529d
Ensure events are always emitted on the shell buffer
xenodium Feb 15, 2026
d57d274
Make sure deferred display also works viewport buffers
xenodium Feb 15, 2026
30a04ef
Don't allow submissions until session is available
xenodium Feb 15, 2026
1649ca2
Don't ask user to kill viewport if already cleaning up
xenodium Feb 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ always go to Evil modes if you need to with ~C-z~).
| agent-shell-qwen-command | Command and parameters for the Qwen Code client. |
| agent-shell-qwen-environment | Environment variables for the Qwen Code client. |
| agent-shell-screenshot-command | The program to use for capturing screenshots. |
| agent-shell-session-load-strategy | How to choose existing sessions when session/list and session/load are available. |
| agent-shell-section-functions | Abnormal hook run after overlays are applied (experimental). |
| agent-shell-show-busy-indicator | Non-nil to show the busy indicator animation in the header and mode line. |
| agent-shell-show-config-icons | Whether to show icons in agent config selection. |
Expand Down
55 changes: 55 additions & 0 deletions agent-shell-active-message.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
;;; agent-shell-active-message.el --- Active message utilities -*- lexical-binding: t; -*-

;; Copyright (C) 2024 Alvaro Ramirez

;; Author: Alvaro Ramirez https://xenodium.com
;; URL: https://github.com/xenodium/agent-shell

;; This package is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.

;; This package is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:
;;
;; Provides a minibuffer progress message for agent-shell.

;;; Code:

(eval-when-compile
(require 'cl-lib))

(cl-defun agent-shell-active-message-show (&key text)
"Show a minibuffer active message displaying TEXT.

Returns an active message alist for use with
`agent-shell-active-message-hide'."
(let* ((reporter (make-progress-reporter (or text "Loading...")))
(timer (run-at-time 0 0.1
(lambda ()
(progress-reporter-update reporter)))))
(list (cons :reporter reporter)
(cons :timer timer))))

(cl-defun agent-shell-active-message-hide (&key active-message)
"Hide ACTIVE-MESSAGE previously shown with
`agent-shell-active-message-show'."
(when active-message
(when-let ((timer (map-elt active-message :timer)))
(when (timerp timer)
(cancel-timer timer)))
(when-let ((reporter (map-elt active-message :reporter)))
(progress-reporter-done reporter)
(message nil))))

(provide 'agent-shell-active-message)

;;; agent-shell-active-message.el ends here
56 changes: 56 additions & 0 deletions agent-shell-ui.el
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,62 @@ NAVIGATION controls navigability:
(put-text-property block-start (or body-end label-right-end label-left-end) 'read-only t)
(put-text-property block-start (or body-end label-right-end label-left-end) 'front-sticky '(read-only))))

(cl-defun agent-shell-ui-update-text (&key namespace-id block-id text append create-new no-undo)
"Update or insert a plain text entry identified by NAMESPACE-ID and BLOCK-ID.

TEXT is the string to insert or append.
When APPEND is non-nil, append TEXT to existing entry.
When CREATE-NEW is non-nil, always create a new entry.
When NO-UNDO is non-nil, disable undo recording."
(save-mark-and-excursion
(let* ((inhibit-read-only t)
(buffer-undo-list (if no-undo t buffer-undo-list))
(qualified-id (format "%s-%s" namespace-id block-id))
(props `(agent-shell-ui-state ((:qualified-id . ,qualified-id))
read-only t
front-sticky (read-only)))
(match (save-mark-and-excursion
(goto-char (point-max))
(text-property-search-backward
'agent-shell-ui-state nil
(lambda (_ state)
(equal (map-elt state :qualified-id) qualified-id))
t))))
(when text
(cond
;; Append to existing entry.
((and match (not create-new) append)
(goto-char (prop-match-end match))
(insert (apply #'propertize text props))
(list (cons :block (list (cons :start (prop-match-beginning match))
(cons :end (point))))
(cons :padding (list (cons :start (prop-match-beginning match))
(cons :end (point))))))
;; Replace existing entry.
((and match (not create-new))
(let ((padding-start (save-excursion
(goto-char (prop-match-beginning match))
(skip-chars-backward "\n")
(point))))
(delete-region (prop-match-beginning match) (prop-match-end match))
(goto-char (prop-match-beginning match))
(insert (apply #'propertize text props))
(list (cons :block (list (cons :start (prop-match-beginning match))
(cons :end (point))))
(cons :padding (list (cons :start padding-start)
(cons :end (point)))))))
;; New entry.
(t
(goto-char (point-max))
(let ((padding-start (point)))
(insert (agent-shell-ui--required-newlines 2))
(let ((block-start (point)))
(insert (apply #'propertize text props))
(list (cons :block (list (cons :start block-start)
(cons :end (point))))
(cons :padding (list (cons :start padding-start)
(cons :end (point)))))))))))))

(defun agent-shell-ui--required-newlines (desired)
"Return string of newlines needed to reach DESIRED before POSITION."
(let ((context (save-mark-and-excursion
Expand Down
16 changes: 12 additions & 4 deletions agent-shell-viewport.el
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ Returns an alist with insertion details or nil otherwise:
(interactive)
(unless (derived-mode-p 'agent-shell-viewport-edit-mode)
(user-error "Not in a shell viewport buffer"))
(when (and (not agent-shell-deferred-initialization)
(not (with-current-buffer (agent-shell-viewport--shell-buffer)
(map-nested-elt agent-shell--state '(:session :id)))))
(user-error "Session not ready... please wait"))
(setq agent-shell-viewport--compose-snapshot nil)
(if agent-shell-prefer-viewport-interaction
(agent-shell-viewport-compose-send-and-wait-for-response)
Expand Down Expand Up @@ -754,10 +758,14 @@ For example, offer to kill associated shell session."
;; triggered by shell buffers attempting to kill viewport buffer.
(let ((agent-shell-viewport--clean-up nil))
(when-let ((shell-buffers (seq-filter (lambda (shell-buffer)
(equal (agent-shell-viewport--buffer
:shell-buffer shell-buffer
:existing-only t)
(current-buffer)))
(and (equal (agent-shell-viewport--buffer
:shell-buffer shell-buffer
:existing-only t)
(current-buffer))
;; Skip shells already shutting down (client
;; is nil after agent-shell--shutdown).
(buffer-local-value 'agent-shell--state shell-buffer)
(map-elt (buffer-local-value 'agent-shell--state shell-buffer) :client)))
(agent-shell-buffers)))
((y-or-n-p "Kill shell session too?")))
(mapc (lambda (shell-buffer)
Expand Down
Loading