Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/src/ui/components/InputPrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1836,7 +1836,7 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
height={Math.min(buffer.viewportHeight, scrollableData.length)}
width="100%"
>
{isAlternateBuffer ? (
{config.getUseTerminalBuffer() ? (

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ScrollableList was causing the render artifacts seen in the bug when rendering when rendering with a background color in alternate buffer mode but not terminalBuffer mode.

We'll eventually make getUserTerminalBuffer() the default so no harm in restricting showing the scrollbars in the input prompt to this case.

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.

high

Replacing isAlternateBuffer with config.getUseTerminalBuffer() as the condition for rendering ScrollableList introduces a regression in scrolling functionality and incorrect behavior in the main buffer:

  1. Broken Auto-scrolling: The useEffect at line 1668 (which ensures the cursor remains visible by scrolling the list) depends on listRef.current. When config.getUseTerminalBuffer() is false, ScrollableList is not rendered, listRef.current remains null, and the input prompt will no longer automatically scroll to follow the cursor. Manual scrolling keys (PageUp/PageDown) provided by ScrollableList are also lost.
  2. Main Buffer Behavior: If a user has terminalBuffer enabled in their config but is currently in the terminal's main scrollback (isAlternateBuffer is false), the prompt will now incorrectly render a ScrollableList with a scrollbar.

To achieve the goal of hiding the scrollbar while maintaining functionality, you should keep the isAlternateBuffer check and instead pass the configuration to the scrollbar prop of ScrollableList (e.g., <ScrollableList ... scrollbar={config.getUseTerminalBuffer()} />).

Suggested change
{config.getUseTerminalBuffer() ? (
{isAlternateBuffer ? (
References
  1. Maintain consistency with existing UI behavior across components. Defer non-standard UX pattern improvements to be addressed holistically rather than in a single component.

<ScrollableList
ref={listRef}
hasFocus={focus}
Expand Down
Loading