Skip to content

fix(tui): scroll transcript when composer has text (#1677)#1715

Closed
tdccccc wants to merge 1 commit into
Hmbown:mainfrom
tdccccc:fix/scroll-with-composer-text
Closed

fix(tui): scroll transcript when composer has text (#1677)#1715
tdccccc wants to merge 1 commit into
Hmbown:mainfrom
tdccccc:fix/scroll-with-composer-text

Conversation

@tdccccc

@tdccccc tdccccc commented May 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When composer_arrows_scroll is enabled, Up/Down keys now always scroll the transcript, regardless of whether the composer has text.
  • Previously, arrows only scrolled when the composer was empty. With text in the composer, mouse wheel events (sent as arrow keys by terminals without mouse capture) navigated input history instead of scrolling the transcript, making it impossible to review earlier conversation while mid-typing.

Problem

On terminals without mouse capture (e.g. Warp on Windows, legacy conhost), mouse wheel events are converted to Up/Down arrow keys by the terminal. When composer_arrows_scroll = true, these arrow keys only triggered transcript scrolling when the composer was empty. If the user had text in the input field, the arrow keys navigated input history instead, preventing scrolling while typing.

Users had to manually add mouse_capture = true to their config to work around this, which isn't obvious.

Fix

Removed the app.input.trim().is_empty() guard in handle_composer_history_arrow. When composer_arrows_scroll is enabled, arrows always scroll the transcript. When disabled (the default on non-Windows with mouse capture), behavior is unchanged.

Test plan

  • Updated history_arrow_handles_nonempty_input to explicitly set composer_arrows_scroll = false
  • Updated composer_arrows_scroll_nonempty_still_navigates_historycomposer_arrows_scroll_nonempty_also_scrolls to verify new behavior
  • All 3119 existing tests pass

When `composer_arrows_scroll` is enabled, Up/Down always scroll the
transcript regardless of whether the composer has text.

Previously arrows only scrolled when the composer was empty. With text
in the composer, mouse wheel events (sent as arrow keys by terminals
without mouse capture) navigated input history instead, making it
impossible to review earlier conversation while mid-typing.

Fixes Hmbown#1677

@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 updates the TUI composer's arrow key logic so that enabling composer_arrows_scroll triggers transcript scrolling even when the composer is not empty. This adjustment prevents terminals that map mouse-wheel events to arrow keys from unintentionally navigating input history during active typing. The test suite has been updated to verify this new behavior and confirm that history navigation remains functional when the scroll option is disabled. I have no feedback to provide.

@Hmbown

Hmbown commented May 17, 2026

Copy link
Copy Markdown
Owner

Thanks for fixing the mouse-wheel-as-arrow draft problem. The scoped behavior was harvested into v0.8.39 via #1734 and credited in the changelog, so I am closing this PR to keep the queue clean. The separate empty-composer Windows default is tracked in #1720 for v0.8.40.

@Hmbown Hmbown closed this May 17, 2026
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.

2 participants