Skip to content

UX: Multi-line input support in REPL #24

@evansenter

Description

@evansenter

Summary

Complex prompts are difficult to enter in the single-line REPL. Support multi-line input for longer prompts.

Proposed Options

Option A: Triple-quote delimiters

> """
Write a function that:
1. Parses JSON
2. Validates the schema
3. Returns typed objects
"""

Option B: Backslash continuation

> Write a function that \
  parses JSON and \
  validates the schema

Option C: Heredoc-style

> <<EOF
Write a function that:
1. Parses JSON
2. Validates the schema  
EOF

Option D: Editor integration

> /edit
# Opens $EDITOR with temp file, submits contents on save

Recommendation

Start with Option A (triple quotes) as it's intuitive and doesn't conflict with shell escapes. Option D is a nice addition for very long prompts.

Implementation Notes

  • rustyline supports custom key bindings and multi-line mode
  • Could detect opening """ and switch to multi-line mode until closing """

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions