Skip to content

Interactive Shell: Multi-line input support #569

Closed

Description

Problem

The Interactive Shell currently processes input line-by-line. Pasting multi-line text (with Unix \n line endings) silently drops newlines because ShellInputHandler.processCharacter() only recognizes \r (0x0D) as Enter. Characters below 0x20 (space) fail the if (ch >= ' ') check and are discarded. This means pasted multi-line content is concatenated into a single line, corrupting the input.

Additionally, there is no support for composing multi-line constructs interactively (e.g., multi-line aggregate() pipelines, function declarations, or if/else blocks).

Current Behavior

  • Bare \n (Unix newline) is silently dropped on paste — all lines merge into one
  • No bracket/brace-matching to detect incomplete expressions
  • No visual continuation prompt (e.g., ...) for multi-line input

Desired Behavior

  1. Paste handling: Pasted text with \n newlines should either:
    • Execute each line sequentially (simple approach), or
    • Queue lines and execute as a batch (more sophisticated)
  2. Interactive multi-line: Detect incomplete expressions (open braces/brackets/parens) and show a continuation prompt instead of executing
  3. Visual feedback: Show ... or similar continuation indicator for multi-line mode

Design Context

Planning doc Step 8 acknowledges multi-line input as future work: "Reserved for future multi-line wrapping support." Terminal resize handling (L6 in PR #508 review) is also deferred pending multi-line editing.

Related

  • PR Feature: Interactive Shell 💻 #508 review findings M11 (newline handling) and L6 (terminal resize)
  • ShellInputHandler.ts — line input processing
  • DocumentDBShellPty.ts — PTY line handling

Activity

  1. added a commit that references this issue on Apr 13, 2026
  2. tnaum-ms commented on Apr 13, 2026

    @tnaum-ms
    CollaboratorAuthor

    Fixed in commit be0d294 (Feature: Add multi-line input handling).\n\nThis adds multi-line Interactive Shell input support, including proper handling of pasted Unix newlines (\n) and continuation prompting for incomplete expressions.\n\nIncluded in PR #573.

  3. tnaum-ms commented on Apr 13, 2026

    @tnaum-ms
    CollaboratorAuthor

    Closing as fixed by be0d294 (PR #573).

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

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions