Skip to content

[TUI] Chat window auto-scrolls to top during streaming responses #11269

@Jeffkim2021

Description

@Jeffkim2021

🐛 Bug Description

When using openclaw tui in the terminal, the chat window automatically scrolls to the top during streaming responses instead of staying at the bottom with the latest message. This forces users to manually scroll down repeatedly to follow the conversation.

📋 Environment

  • Interface: openclaw tui (Terminal User Interface, NOT web browser)
  • Terminal: SSH session (xterm-256color)
  • Terminal Size: 44 rows × 128 columns
  • OpenClaw Version: 2026.2.1 (ed4529e)
  • OS: Linux
  • Shell: zsh
  • Multiplexer: None (direct terminal, no tmux/screen)

🔄 Steps to Reproduce

  1. Launch openclaw tui in a terminal
  2. Start a conversation
  3. Ask a question that generates a long response with:
  • Multiple code blocks
  • Tool executions (file reads, exec commands)
  • Streaming text output
  1. Observe the chat window during the streaming response

Expected behavior:

  • Chat window stays scrolled to the bottom (latest message)
  • Auto-scrolls down as new content streams in
  • User sees the latest content being generated

Actual behavior:

  • Chat window jumps to the top randomly during streaming
  • User must manually scroll down to see the latest content
  • Happens multiple times during a single long response
  • Interrupts reading flow

📊 Frequency

  • How often: Very frequently, almost every long response
  • Severity: Moderate - doesn't break functionality but significantly impacts UX
  • Workaround: Manual scrolling with arrow keys/Page Down (inconvenient)

🎯 Impact

User Workflow:

  • User primarily works from PC terminal/CLI
  • Prefers TUI over web UI for terminal-based workflow
  • Telegram is used only for mobile/on-the-go scenarios
  • This bug makes the primary interface (TUI) frustrating to use
  • Interrupts reading flow, especially when following code examples or tool output

💡 Suspected Cause

Possible issues in TUI implementation:

  1. Terminal buffer scroll position not preserved during content updates
  2. Blessed/ncurses rendering resets scroll to top on re-render
  3. Auto-scroll logic targets wrong position (top vs. bottom)
  4. Scroll anchor not maintained during streaming content append
  5. TUI framework event handling issue during async updates

🔍 Additional Context

When it's most noticeable:

  • Long responses (> 500 tokens)
  • Multiple tool calls in sequence
  • Code blocks and formatted output
  • Messages with many sections/headers
  • Fast streaming (high token/sec rate)

Terminal-specific considerations:

  • Issue may be related to terminal emulator behavior
  • Could be affected by terminal size/resize events
  • May differ between different TUI libraries (blessed/ink/etc.)

Temporary workarounds:

  • Using web UI instead (not preferred for terminal workflow)
  • Using Telegram bot (not preferred for PC work)
  • Waiting for response to complete before scrolling
  • Constantly re-scrolling manually with Page Down/Down arrow

📝 Proposed Solution

  • Implement scroll anchor to bottom of chat pane in TUI
  • Preserve scroll position during terminal re-renders
  • Add "auto-scroll" preference toggle in TUI settings
  • Consider sticky "↓ scroll to bottom" indicator if user scrolls up
  • Test with different terminal emulators (gnome-terminal, konsole, alacritty, tmux)

🔗 Related

  • TUI framework scroll handling
  • Terminal buffer management
  • Async streaming updates in terminal UI

🧪 Testing Suggestions

  1. Test in different terminal emulators
  2. Test with different terminal sizes
  3. Test with varying streaming speeds
  4. Test with/without tmux/screen

Reporter: User via agent (PC/CLI primary workflow)
Date: 2026-02-08
Interface: Terminal TUI (openclaw tui), NOT web browser
Priority: Medium (UX issue affecting primary interface)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivitytuiTerminal UI changes

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions