Skip to content
This repository was archived by the owner on Oct 29, 2026. It is now read-only.

Console: auto-scroll to latest output and keep focus on the prompt - #40

Merged
kukirin-ui merged 1 commit into
mainfrom
console-autoscroll
Oct 13, 2026
Merged

kukirin-ui merged 1 commit into
mainfrom
console-autoscroll

Conversation

@kukirin-ui

Copy link
Copy Markdown
Owner

Fixes the Console jumping back to the top after a command.

  • Each render rebuilt #term with scrollTop 0. Now, after a new block is added or a job finishes, the terminal and the window body scroll to the last line and the > input gets focus (with preventScroll).
  • During streaming output the window body also follows the newest line (the terminal already did).
  • In-place re-renders keep the user's scroll position if they had scrolled up to read older output; if they were at the bottom, it stays pinned to the bottom.
  • No CSS changes, so portrait and landscape layouts are untouched.

Tested in headless Chrome with a mocked Termux bridge (portrait 412x915 and landscape 915x412): after two commands the output is at the last line (exit 0) and the input is focused. On main the same test leaves the view above the end and the input unfocused.

@kukirin-ui
kukirin-ui merged commit c85835a into main Oct 13, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant