Skip to content

feat(tui): add /edit-last command to open last assistant message in external editor #11598

Closed

Description

@jung-ho-1231

Description

When LLM responses are long, it is helpful to open them in an external editor (vim/nvim/code) to read and understand better. Currently, users have to scroll through long responses in the terminal, which can be difficult to navigate.

Proposed Solution

Add a /edit-last slash command that:

  1. Opens the last assistant message in the external editor configured via VISUAL or EDITOR environment variable
  2. Allows users to edit the content if needed
  3. Loads the edited content back into the input prompt
  4. Users can then press Enter to send the edited message

Use Cases

  • Reading long code explanations or documentation generated by the AI
  • Editing or refining AI responses before sending follow-up questions
  • Better navigation of multi-page responses using familiar editor keybindings
  • Copying specific sections from the response more easily

Requirements

Users must have VISUAL or EDITOR environment variable set:

export EDITOR=vim    # or nvim, nano, code, etc.
export VISUAL=nvim   # takes precedence over EDITOR

Implementation Notes

  • Command should only be visible when editor is configured
  • Should handle edge cases (no assistant messages, no text content)
  • Should detect if changes were made (show "No changes made" if not)
  • Should detect empty content after editing

Alternatives Considered

  • Copy to clipboard and manually open editor (more steps)
  • Built-in pager (less familiar than user's preferred editor)
  • Export entire session (overkill for single message editing)

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Feb 1, 2026
  2. github-actions commented on Apr 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions