[codex] Fix issue 957 long paste display#959
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54dc1dd625
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (hasReadlineActiveRegion(data)) { | ||
| state.clearPending = Math.max(state.clearPending, 3); | ||
| return stripReadlineActiveRegion(data); |
There was a problem hiding this comment.
Scope readline escape stripping to actual paste echoes
After any long paste, this branch strips every \x1b[7m/\x1b[27m pair from all terminal output while the 4-second fix window is active. Those are normal SGR reverse-video codes used by full-screen tools and prompts, so running something like less, vim, or other ncurses output immediately after a long paste will lose intended styling and can leave display state mismatched. The filter should be constrained to the specific readline echo pattern instead of globally removing these sequences during the window.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ebcab8c4ba
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (hasReadlineActiveRegion(data) && isPasteEcho) { | ||
| state.clearPending = Math.max(state.clearPending, 3); | ||
| return stripReadlineActiveRegion(data); |
There was a problem hiding this comment.
Strip readline markers only from matched paste-echo segment
When the paste-fix window is active, this branch removes \x1b[7m/\x1b[27m from the entire data chunk as soon as any line in that chunk looks like paste echo. If bash combines the echoed pasted line with other reverse-video content in the same write (for example prompt/mode indicators or TUI status text), the unrelated styling is also stripped, which is a visible rendering regression introduced by this fix path. Restricting marker removal to just the matched paste-echo span avoids clobbering unrelated output.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 60ae9fbc0c
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pasteTextIntoTerminal(term, text, { | ||
| scrollOnPaste: shouldScrollOnTerminalPaste(ctx.terminalSettingsRef.current), | ||
| }); |
There was a problem hiding this comment.
Preserve scrollOnPaste=false when routing through term.paste
Calling pasteTextIntoTerminal here routes clipboard text through term.paste, which emits onData as regular user input; in createXTermRuntime that path still runs scrollToBottomAfterInput(data). In sessions where bracketed paste bytes are not added (for example disableBracketedPaste/ignoreBracketedPasteMode is enabled), pasted text is treated as printable input and will scroll even when scrollOnPaste is false, so the new paste path no longer honors the paste-specific scroll setting that the previous direct writeToSession path respected.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Validation
node --test --import tsx components/terminal/runtime/terminalUserPaste.test.tsnode --test --import tsx components/terminal/runtime/serialLineInput.test.tsnpm run lintnpm testnpm run buildAddresses the long-paste display part of #957.