Title: feat(ui): add bracketed paste with large-paste marker collapsing by jeoor · Pull Request #102 · lessweb/deepcode-cli · GitHub
Open Graph Title: feat(ui): add bracketed paste with large-paste marker collapsing by jeoor · Pull Request #102 · lessweb/deepcode-cli
X Title: feat(ui): add bracketed paste with large-paste marker collapsing by jeoor · Pull Request #102 · lessweb/deepcode-cli
Description: Summary
When pasting a large block of text (>10 lines or >1000 characters), the content is replaced with a compact marker like [paste #1 +63 lines] instead of inserting the full text.
Features
Bracketed paste detection — Detects ESC[200~ / ESC[201~ and dispatches pasted text as a single atomic event
Large paste collapsing — Pastes >10 lines or >1000 chars are stored and replaced with a compact marker
Ctrl+O toggle — Expand to view/edit full content, collapse back to marker (with setTimeout(0) to mitigate rendering issues)
Atomic deletion — Backspace/delete on a paste marker removes the entire marker at once
Auto-expand on submit — Markers are expanded to full content before sending to the LLM
Yellow highlighting — Markers are highlighted with chalk.yellow
Lazy text cleaning — Control char filtering and line ending normalization are deferred to expand/submit time
Array-based chunk buffering — Uses chunks[] instead of string += concatenation to avoid O(n²) on multi-chunk pastes
Implementation
File
Changes
src/ui/prompt/useTerminalInput.ts
Paste bracketing: detection, chunk buffering, same-chunk immediate processing
src/ui/promptBuffer.ts
cleanPasteContent, expandPasteMarkers, findPasteMarkerBefore/At/Containing, deletePasteMarkerBackward/Forward, hasActivePasteMarkers
src/ui/prompt/cursor.ts
useBracketedPaste hook (follows existing useTerminalExtendedKeys pattern)
src/ui/prompt/index.ts
Export useBracketedPaste
src/ui/PromptInput.tsx
handlePaste, expandPasteMarkerAtCursor, rendering with yellow highlight, hint text
Verification
typecheck — 0 error
eslint — 0 error, 0 warning
prettier — All matched files use Prettier code style
test — 18/18 prompt buffer tests pass
build — 414.7kb, successful
Known Limitation
Expand/collapse briefly clears Ink
Open Graph Description: Summary When pasting a large block of text (>10 lines or >1000 characters), the content is replaced with a compact marker like [paste #1 +63 lines] instead of inserting the full text. Featur...
X Description: Summary When pasting a large block of text (>10 lines or >1000 characters), the content is replaced with a compact marker like [paste #1 +63 lines] instead of inserting the full text....
Opengraph URL: https://github.com/lessweb/deepcode-cli/pull/102
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:25a00567-a28b-d16c-fdb2-c87bf79e73e9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9EA0:2702E6:4D1F6C:66E88F:6A4D32E3 |
| html-safe-nonce | 49a0604a840e03145c322febcee5bcf9c536d1b160d5020d0bb2b11508ae5427 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUEwOjI3MDJFNjo0RDFGNkM6NjZFODhGOjZBNEQzMkUzIiwidmlzaXRvcl9pZCI6IjQxMjI0MjIyMjIyMzE3NzgwMTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 16fff565ebf0adf38cbb74c1fcc967ad1279cb4c2c057ded28818380e8de2615 |
| hovercard-subject-tag | pull_request:3716958622 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/lessweb/deepcode-cli/pull/102/files |
| twitter:image | https://avatars.githubusercontent.com/u/142088385?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/142088385?s=400&v=4 |
| og:image:alt | Summary When pasting a large block of text (>10 lines or >1000 characters), the content is replaced with a compact marker like [paste #1 +63 lines] instead of inserting the full text. Featur... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/lessweb/deepcode-cli git https://github.com/lessweb/deepcode-cli.git |
| octolytics-dimension-user_id | 118287711 |
| octolytics-dimension-user_login | lessweb |
| octolytics-dimension-repository_id | 1223512305 |
| octolytics-dimension-repository_nwo | lessweb/deepcode-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1223512305 |
| octolytics-dimension-repository_network_root_nwo | lessweb/deepcode-cli |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width