fix(desktop): make terminal output selectable - #4980
Conversation
Mirror the retained canvas grid into a transparent text layer so native mouse selection and clipboard copy work without replacing the terminal's canvas renderer. Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
|
[P1] Preserve soft-wrap boundaries before exposing clipboard text — |
Carry terminal row wrap geometry through the retained-grid transport so selection serialization joins visual rows only when they belong to the same logical line. Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
|
[P1] Do not trim spaces from a soft-wrapped row — The wrap separator is now correct, but |
Only trim terminal padding from hard-ended rows. A boundary space on a soft-wrapped row is command data and must survive selection serialization. Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Render one selectable DOM row per terminal screen row for accurate native hit testing, then serialize the selected cell range on copy so soft wraps remain absent from clipboard text. Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Clamp native DOM range endpoints to retained grapheme boundaries before serializing clipboard text, and keep empty-row placeholder offsets within the terminal model. Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Summary
Why
Buzz Term renders output entirely on a canvas and deliberately called
preventDefault()on viewport mouse-down, so native selection and copy could not work. A canvas has no selectable text even if that cancellation is removed.The transparent text layer stays aligned with the visible cell grid, lets WebView native selection drive drag highlighting and copy, and follows active-session switches without changing the renderer or PTY protocol.
Validation
pnpm --dir desktop typecheckpnpm --dir desktop test— 4,373 passeddesktop-check,desktop-test, andbranch-skewhooks passed on1f2a3f8db63f6fe36b4a28bc911aea3c5186b2b0