fix: multi-line support in the interactive shell#591
Merged
tnaum-ms merged 6 commits intorel/release_0.8.0from Apr 17, 2026
Merged
fix: multi-line support in the interactive shell#591tnaum-ms merged 6 commits intorel/release_0.8.0from
tnaum-ms merged 6 commits intorel/release_0.8.0from
Conversation
…user prompt options
… warning settings
Contributor
There was a problem hiding this comment.
Pull request overview
Improves the Interactive Shell editing experience by making cursor movement and re-rendering wrap-aware (including deferred-wrap edge cases) and by adding multi-line paste handling with a configurable behavior and optional user prompt.
Changes:
- Track cursor row across renders and use full re-rendering for Left/Right/Home/End to correctly cross wrapped-row boundaries.
- Add multi-line paste detection in the PTY with a new
documentDB.shell.multiLinePasteBehaviorsetting and an optional QuickPick prompt. - Expand Jest coverage for line-wrapping/editing behavior and multi-line paste flows; update VS Code mocks and localization bundle.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/documentdb/shell/ShellInputHandler.ts | Adds _lastCursorRow tracking and wrap/deferred-wrap-aware cursor repositioning; switches cursor navigation to re-rendering. |
| src/documentdb/shell/ShellInputHandler.test.ts | Updates navigation assertions and adds extensive wrap/deferred-wrap regression tests. |
| src/documentdb/shell/DocumentDBShellPty.ts | Detects multi-line paste, consults new setting, and optionally prompts user to join/execute/cancel. |
| src/documentdb/shell/DocumentDBShellPty.test.ts | Updates configuration mocking and adds tests for dialog behavior and paste execution modes. |
| src/mocks/vscode.js | Adds QuickPickItemKind to support separator items in tests. |
| package.json | Introduces documentDB.shell.multiLinePasteBehavior configuration contribution. |
| l10n/bundle.l10n.json | Adds localized strings for the new QuickPick UI. |
When the terminal is resized, xterm.js reflows content but _lastCursorRow was not updated, causing reRenderLine() to navigate to the wrong prompt row. Reset it to 0 in setColumns().
Change .filter((l) => l.length > 0) to .filter((l) => l.trim().length > 0) so that whitespace-only lines are excluded. Previously, a paste like "db.test\n \n.find()" would produce a spurious double space.
mockPasteBehavior() now preserves documentDB.shell.display.colorOutput=false alongside documentDB.timeout, preventing brittleness if paste tests ever check rendered ANSI output.
Collaborator
Author
|
Fixed whitespace-only line handling in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…lInputHandler