feat(input): insert terminal paste as one literal edit - #179
Merged
Conversation
Greptile SummaryThis PR adds literal bracketed-paste handling throughout the terminal editor.
Confidence Score: 5/5The PR appears safe to merge; the prior empty-paste prefix issue is fixed and no new actionable failures remain. Empty editor paste now resets the keymap and clears prefix status, while every directory-picker paste is routed through the unhandled-key path. The roadmap thread was manually resolved after owainlewis explained that issue #164 had already shipped in the base commit and issue #165 remains open until this PR merges.
|
| Filename | Overview |
|---|---|
| src/app.rs | Routes paste events by editor state, performs literal single-edit insertion, sanitizes prompt paste, and clears pending prefixes. |
| src/input.rs | Adds single-line paste normalization that collapses CRLF and replaces supported line separators and tabs while dropping other controls. |
| src/terminal.rs | Enables bracketed paste during setup and records the cleanup obligation before a potentially failing flush. |
| src/renderer.rs | Adds coverage confirming literal pasted control characters are sanitized before terminal rendering. |
| tests/signal_cleanup.rs | Adds PTY coverage for literal paste, one-step undo, empty-paste prefix cancellation, and paste-mode cleanup. |
Reviews (2): Last reviewed commit: "fix(input): cancel key prefixes on empty..." | Re-trigger Greptile
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.
Terminal paste now arrives as one literal edit, preserving tabs, line endings, Unicode, and control characters without invoking key bindings or automatic indentation. Editable prompts flatten line breaks and tabs, discard other controls, and wait for an actual Enter; pasted text cannot confirm a dirty quit.
Empty paste also cancels a pending key prefix without changing text or history.
Bracketed paste is enabled during terminal setup and disabled during cleanup, including a failed setup flush. Terminal integration coverage checks exact saved bytes, one undo, and cleanup across existing exit paths.
Validation: formatting, strict all-target Clippy, release build, 360 unit tests, and the new PTY paste test pass locally. Ten of twelve terminal integration tests pass locally; the two existing redirected-input tests remain sandbox-restricted and require the full macOS CI run. A release PTY smoke passed literal paste, undo/redo, command and file prompts, dirty-quit isolation, and shell restoration. Fresh independent review approved with no findings.
Closes #165.