Skip to content

Add option to disable automatic scroll-to-bottom on input #218

@futpib

Description

@futpib

Problem

TerminalView calls _scrollToBottom() after every input event (_onInsert, _handleKeyEvent, _onAction, _onKeyboardShow). This jumps the scroll position to maxScrollExtent unconditionally.

When embedding TerminalView in a layout where the viewport is smaller than the terminal (e.g. keeping the PTY dimensions stable while the on-screen keyboard is open, using autoResize: false and an outer ScrollView), this causes a visible flicker: the terminal jumps to the bottom of the scrollback buffer for one frame before the parent can correct the position.

There is no way to disable this behavior without forking the package. The scroll controller is shared (passed via scrollController parameter), but _scrollToBottom() bypasses it by accessing the ScrollPosition directly through _scrollableKey.

Use case

Android terminal app that keeps PTY dimensions stable when the soft keyboard opens by using autoResize: false and manually sizing the terminal widget. The built-in _scrollToBottom() fights external scroll positioning and causes flicker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions