Function: eca-workspaces-new-chat

eca-workspaces-new-chat is an interactive and natively compiled function defined in eca-workspaces.el.

Signature

(eca-workspaces-new-chat)

Documentation

Start a new chat in a workspace.

Completion offers the running workspaces, defaulting to the one at point, and accepts any other existing directory, starting a session for it. Asks for an optional initial prompt which is sent right away.

Key Bindings

eca-workspaces-mode-map +

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-workspaces.el
(defun eca-workspaces-new-chat ()
  "Start a new chat in a workspace.
Completion offers the running workspaces, defaulting to the one at
point, and accepts any other existing directory, starting a
session for it.  Asks for an optional initial prompt which is sent
right away."
  (interactive)
  (let* ((workspace (eca-workspaces--read-workspace))
         (session (if (eca--session-p workspace)
                      workspace
                    (eca-session-for-root workspace)))
         (prompt (string-trim (read-string "Initial prompt (optional): "))))
    (if session
        (progn (eca-chat--new-chat session)
               (eca-workspaces--send-initial-prompt session prompt))
      (eca-start-session
       (eca-create-session (list workspace))
       (lambda (started)
         (eca-workspaces--send-initial-prompt started prompt))))))