fix: name hermes vterm buffers by session id; drop autoload cookies

This commit is contained in:
2026-08-11 11:03:59 -04:00
parent baa7441f3b
commit 655e9d929f
2 changed files with 20 additions and 24 deletions

View File

@@ -2000,12 +2000,13 @@ already saved to ~.hermes-sessions~ at the project root.
;; -------------------------------------------------------------------
;; Org link type: [[hermes:20260718_162500_a1b2c3][Resume — Title]]
;; -------------------------------------------------------------------
(org-link-set-parameters "hermes"
:follow (lambda (id)
(gortium/hermes--open-vterm
(format "hermes chat --resume %s" id)
"*hermes*"))
:help-echo "Resume this Hermes chat session in vterm")
(after! org
(org-link-set-parameters "hermes"
:follow (lambda (id)
(gortium/hermes--open-vterm
(format "hermes chat --resume %s" id)
(format "*hermes-%s*" id)))
:help-echo "Resume this Hermes chat session in vterm"))
;; -------------------------------------------------------------------
;; Helpers — build commands, detect project
@@ -2105,7 +2106,6 @@ Remote needs ssh -t + docker exec -it (PTY required)."
;; -------------------------------------------------------------------
;; Start a new Hermes session (with title prompt)
;; -------------------------------------------------------------------
;;;###autoload
(defun gortium/hermes-start (title &optional remote-host)
"Start a new Hermes session for the current project.
With prefix arg, prompt for remote SSH host (default: lazyworkhorse)."
@@ -2122,12 +2122,11 @@ With prefix arg, prompt for remote SSH host (default: lazyworkhorse)."
(gortium/hermes-append-session sfile id title)
(gortium/hermes--open-vterm
(gortium/hermes--launch-cmd id remote-host)
(format "*hermes-%s*" name)))))
(format "*hermes-%s*" id)))))
;; -------------------------------------------------------------------
;; Browse / resume past sessions (completing-read menu)
;; -------------------------------------------------------------------
;;;###autoload
(defun gortium/hermes-resume ()
"Browse and resume a past Hermes session from the current project."
(interactive)
@@ -2161,12 +2160,12 @@ With prefix arg, prompt for remote SSH host (default: lazyworkhorse)."
(session (nth idx sessions))
(id (plist-get session :id)))
(gortium/hermes--open-vterm
(format "hermes chat --resume %s" id))))))))
(format "hermes chat --resume %s" id)
(format "*hermes-%s*" id))))))))
;; -------------------------------------------------------------------
;; Link external session to current project
;; -------------------------------------------------------------------
;;;###autoload
(defun gortium/hermes-link-session (session-id title)
"Link an existing Hermes session to the current project.
If SESSION-ID is empty, show a menu of recent sessions to browse."
@@ -2213,7 +2212,6 @@ If SESSION-ID is empty, show a menu of recent sessions to browse."
;; -------------------------------------------------------------------
;; Remove a linked session from project
;; -------------------------------------------------------------------
;;;###autoload
(defun gortium/hermes-remove-session ()
"Remove a Hermes session from the current project's .hermes-sessions."
(interactive)

View File

@@ -1196,12 +1196,13 @@ DIFF:
;; -------------------------------------------------------------------
;; Org link type: [[hermes:20260718_162500_a1b2c3][Resume — Title]]
;; -------------------------------------------------------------------
(org-link-set-parameters "hermes"
:follow (lambda (id)
(gortium/hermes--open-vterm
(format "hermes chat --resume %s" id)
"*hermes*"))
:help-echo "Resume this Hermes chat session in vterm")
(after! org
(org-link-set-parameters "hermes"
:follow (lambda (id)
(gortium/hermes--open-vterm
(format "hermes chat --resume %s" id)
(format "*hermes-%s*" id)))
:help-echo "Resume this Hermes chat session in vterm"))
;; -------------------------------------------------------------------
;; Helpers — build commands, detect project
@@ -1301,7 +1302,6 @@ Remote needs ssh -t + docker exec -it (PTY required)."
;; -------------------------------------------------------------------
;; Start a new Hermes session (with title prompt)
;; -------------------------------------------------------------------
;;;###autoload
(defun gortium/hermes-start (title &optional remote-host)
"Start a new Hermes session for the current project.
With prefix arg, prompt for remote SSH host (default: lazyworkhorse)."
@@ -1318,12 +1318,11 @@ With prefix arg, prompt for remote SSH host (default: lazyworkhorse)."
(gortium/hermes-append-session sfile id title)
(gortium/hermes--open-vterm
(gortium/hermes--launch-cmd id remote-host)
(format "*hermes-%s*" name)))))
(format "*hermes-%s*" id)))))
;; -------------------------------------------------------------------
;; Browse / resume past sessions (completing-read menu)
;; -------------------------------------------------------------------
;;;###autoload
(defun gortium/hermes-resume ()
"Browse and resume a past Hermes session from the current project."
(interactive)
@@ -1357,12 +1356,12 @@ With prefix arg, prompt for remote SSH host (default: lazyworkhorse)."
(session (nth idx sessions))
(id (plist-get session :id)))
(gortium/hermes--open-vterm
(format "hermes chat --resume %s" id))))))))
(format "hermes chat --resume %s" id)
(format "*hermes-%s*" id))))))))
;; -------------------------------------------------------------------
;; Link external session to current project
;; -------------------------------------------------------------------
;;;###autoload
(defun gortium/hermes-link-session (session-id title)
"Link an existing Hermes session to the current project.
If SESSION-ID is empty, show a menu of recent sessions to browse."
@@ -1409,7 +1408,6 @@ If SESSION-ID is empty, show a menu of recent sessions to browse."
;; -------------------------------------------------------------------
;; Remove a linked session from project
;; -------------------------------------------------------------------
;;;###autoload
(defun gortium/hermes-remove-session ()
"Remove a Hermes session from the current project's .hermes-sessions."
(interactive)