← Back to Pull requests

Pause output while the user holds the scrollbar thumb #20926

Open
unknown opened this pull request with 258 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 17, 2026 05:32 UTC
Author

Summary of the Pull Request

Holding the scrollbar thumb now holds the text. With a full scrollback (9001 rows by default), every new line evicts the oldest row, so once the view reaches the top of the buffer the text under a held thumb keeps moving. During a flood that takes well under a second. While the thumb is held, ControlCore stops reading connection output and the program blocks on its writes through normal pipe backpressure, like conhost does in mark mode. Releasing the thumb resumes it.

Stacked on #20784.

References and Relevant Issues

#20784

Detailed Description of the Pull Request / Additional comments

TermControl pauses on ThumbTrack and resumes on EndScroll. Losing pointer capture ends the drag with EndScroll too. The connection's reader thread waits before it takes the terminal lock, so the UI thread never waits on it. Close, connection swaps and Detach (tear-out) all resume, and a 30 s failsafe resumes on its own if a release is ever missed. Output raised on the UI thread itself (e.g. EchoConnection) is never blocked. Only the thumb pauses output; scrolling up with the wheel doesn't.

AI disclosure: developed with GitHub Copilot (an AI coding agent) at my direction, including the tests and this description.

Validation Steps Performed

.\build\scripts\Run-Tests.ps1 -MatchPattern 'Control.Unit.Tests.dll' -Platform ARM64 -Configuration Debug: 33/33 passed, including 2 new tests: output written from another thread isn't applied until resume, and Close releases a paused writer. The Close test fails without the resume in _closeConnection. Checked by hand in Terminal Dev (ARM64 Debug) with a continuous output flood and the default 9001-row scrollback: holding the thumb holds the text, and output picks up again on release.

PR Checklist


  • Closes #xxx (N/A, no tracking issue)

  • Tests added/passed

  • Documentation updated

  • - If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)
  • Diff: 258 lines (+193 / -65) across 3 files Reviewer: DHowett Review duration: 8034m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.39) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 258 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.332
    Real PR Conversation Timeline
    1 comments
    "Review active on #20926"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.2% (MEDIUM) · Higher = larger blast radius
    39.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.4% · Safe to merge
    22.4%