Skip to content

fix: prevent paste boundary escapes and reflow content loss - #64

Merged
simota merged 2 commits into
mainfrom
fix/paste-markers-and-reflow-content
Sep 5, 2026
Merged

fix: prevent paste boundary escapes and reflow content loss#64
simota merged 2 commits into
mainfrom
fix/paste-markers-and-reflow-content

Conversation

@simota

@simota simota commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Prevent nested bracketed-paste markers from ending a paste early. Removing an embedded marker could join the surrounding bytes into a new ESC[201~, leaving subsequent text outside the paste boundary. Sanitize the output suffix in a single pass so reconstructed markers are removed too.
  • Preserve populated rows below the cursor when resizing columns and rows together, or when narrower columns produce more wrapped rows. Reflow now accounts for the last content row and moves displaced top rows into scrollback. For example, resizing a populated 10×4 terminal with the cursor at home to 11×3 keeps the fourth line instead of discarding it.

Five regression tests cover every marker split point, deeply nested markers, widening/narrowing during row shrink, wrapped content below the cursor, and erased trailing rows with saved-cursor preservation.

Test plan

  • Confirmed the new bug reproductions fail before the fixes and pass afterward.
  • cargo test -p noa-app -p noa-grid --lib --quiet
  • cargo test --workspace --quiet (passed outside the sandbox to allow IPC loopback listeners)
  • cargo fmt --all --check
  • git diff --check

Validation uses deterministic paste-byte and terminal-grid assertions; no interactive macOS screenshot or recording was captured.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T00:04:32.281887Z 8b18090 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@simota
simota merged commit c6dd455 into main Sep 5, 2026
1 check passed
@simota simota mentioned this pull request Sep 5, 2026
@simota
simota deleted the fix/paste-markers-and-reflow-content branch September 5, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant