Skip to content

fix(tui): default composer_arrows_scroll to true on Windows (#1255)#1578

Closed
kunpeng-ai-lab wants to merge 1 commit into
Hmbown:mainfrom
kunpeng-ai-lab:fix/win10-scroll-fix
Closed

fix(tui): default composer_arrows_scroll to true on Windows (#1255)#1578
kunpeng-ai-lab wants to merge 1 commit into
Hmbown:mainfrom
kunpeng-ai-lab:fix/win10-scroll-fix

Conversation

@kunpeng-ai-lab

Copy link
Copy Markdown

On Windows terminals (including Windows Terminal) mouse-wheel events are often mapped to arrow-key sequences rather than delivered as crossterm MouseEventKind::ScrollUp/ScrollDown. The existing fallback only enabled composer_arrows_scroll when mouse_capture was off, but on Windows Terminal mouse_capture defaults to on because WT_SESSION is set. This left Win10 users unable to scroll the transcript with the mouse wheel.

This PR defaults composer_arrows_scroll to true on Windows regardless of the mouse-capture flag so that wheel-mapped arrow keys scroll the transcript instead of cycling input history.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the default behavior of composer_arrows_scroll to be true on Windows, regardless of mouse capture settings, to address terminal behavior where wheel events are mapped to arrow keys. The test suite has been updated with platform-specific logic to reflect these changes. The reviewer suggested simplifying the conditional logic in app.rs using a more concise boolean expression for improved readability.

Comment thread crates/tui/src/tui/app.rs Outdated
Comment on lines +1570 to +1574
.unwrap_or(if cfg!(windows) {
true
} else {
!use_mouse_capture
}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and conciseness, you can simplify this conditional logic using a boolean expression.

                .unwrap_or(cfg!(windows) || !use_mouse_capture),

)

On Windows terminals (including Windows Terminal) mouse-wheel events are
often mapped to arrow-key sequences rather than delivered as crossterm
MouseEventKind::ScrollUp/ScrollDown.  The existing fallback only enabled
composer_arrows_scroll when mouse_capture was off, but on Windows Terminal
mouse_capture defaults to on because WT_SESSION is set.  This left Win10
users unable to scroll the transcript with the mouse wheel.

Default composer_arrows_scroll to true on Windows regardless of the
mouse-capture flag so that wheel-mapped arrow keys scroll the transcript
instead of cycling input history.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant