Scrolling with the keyboard doesn't update the scrollbar #1121

Closed
opened 2026-01-30 22:16:59 +00:00 by claunia · 3 comments
Owner

Originally created by @zadjii-msft on GitHub (May 15, 2019).

Use Ctrl+Shift+Arrows/PgUp/PgDn to scroll the contents of the buffer.

Expected: The scrollbar on the control updates as the viewport moves.

Actual: It doesn't.

From discussion in #747.

Originally created by @zadjii-msft on GitHub (May 15, 2019). Use Ctrl+Shift+Arrows/PgUp/PgDn to scroll the contents of the buffer. Expected: The scrollbar on the control updates as the viewport moves. Actual: It doesn't. From discussion in #747.
Author
Owner

@Kapperchino commented on GitHub (May 21, 2019):

@zadjii-msft Quick question, what checks do I need to do for the scroll bar. Currently I just set the value without doing much checking other than clamping it.
_scrollBar.Value(static_cast<int>(viewTop));

@Kapperchino commented on GitHub (May 21, 2019): @zadjii-msft Quick question, what checks do I need to do for the scroll bar. Currently I just set the value without doing much checking other than clamping it. ` _scrollBar.Value(static_cast<int>(viewTop));`
Author
Owner

@zadjii-msft commented on GitHub (May 21, 2019):

You probably need this bit from void TermControl::_MouseScrollHandler(const double mouseDelta)

        // Clear our expected scroll offset. The viewport will now move in
        //      response to our user input.
        _lastScrollOffset = std::nullopt;

Otherwise you can get some real weird behavior if (for example) the terminal is currently outputting text and the user tries to scroll with the mouse/keyboard

@zadjii-msft commented on GitHub (May 21, 2019): You probably need this bit from `void TermControl::_MouseScrollHandler(const double mouseDelta)` ``` // Clear our expected scroll offset. The viewport will now move in // response to our user input. _lastScrollOffset = std::nullopt; ``` Otherwise you can get some real weird behavior if (for example) the terminal is currently outputting text and the user tries to scroll with the mouse/keyboard
Author
Owner

@zadjii-msft commented on GitHub (May 24, 2019):

Hey look, this was merged

@zadjii-msft commented on GitHub (May 24, 2019): Hey look, this was merged
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1121