Skip to content

chatgpt-shell-after-command-functions can't handle multiline output well #412

@tothedarktowercame

Description

@tothedarktowercame

Multiline output is truncated after first line in the after hook.

  (defun demo-system-prompt (_command)
    (let ((block "Simply echo the following in your response ---FROM-TATAMI-EDN---\n{:demo
  1}\n---END-FROM-TATAMI-EDN---\n"))
      (setq chatgpt-shell-system-prompts `((\"General\" . ,block)))
      (setq-local chatgpt-shell-system-prompt block)))

  (add-hook 'chatgpt-shell-before-command-functions #'demo-system-prompt)

  (defun demo-after-command (command output _success)
    (message \"HOOK output=%S\" output))

  (add-hook 'chatgpt-shell-after-command-functions #'demo-after-command)

Steps to repro:

  1. Evaluate the above in a fresh Emacs session (supply your OpenAI key as usual)
  2. Start M-x chatgpt-shell (profile “General”).
  3. Ask any prompt; the model echoes the EDN block.
  4. Observe HOOK output — the hook never sees the body after ---FROM-TATAMI-EDN---.

The underlying issue seems to be with shell-maker, but reporting it here first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions