Skip to content

Keep terminal scroll position on input - #30889

Merged
nwparker merged 12 commits into
stablyai:mainfrom
mvanhorn:fix/terminal-scroll-on-input
Nov 3, 2026
Merged

nwparker merged 12 commits into
stablyai:mainfrom
mvanhorn:fix/terminal-scroll-on-input

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

A terminal pane that is scrolled up no longer has to jump to the latest output when you type. There is a setting to keep that jump, or turn it off.

What Changed

Before, typing or pasting in a scrolled-up terminal always snapped the viewport to the bottom.

After, Settings > Terminal > Terminal Interaction has Scroll to Bottom on Input. It is on by default. Turn it off and the pane stays where you scrolled while you type or paste.

The switch maps to xterm's scrollOnUserInput on live panes, new panes, the dashboard preview terminal, and the plain SSH terminal view. Changes apply to open panes without a restart.

Why

Reading earlier output and then typing a follow-up is common. Jumping away on every keystroke makes that harder. A single setting keeps the current default for everyone else.

Linked Issue

Closes #30492

Testing

  • Automated tests added
  • Unit tests: TerminalInteractionSection (switch + localized search), terminal appearance live-apply, pane lifecycle default, and an xterm contract test that keeps a scrolled-up viewport with the option off (fails if the option is flipped back on)
  • Component fixture: settings/terminal/TerminalInteractionSection (default on / off)
  • Manual: macOS arm64 in the PR comments. Paste, Windows/Linux, and the dashboard preview were not hand-tested; paste uses the same xterm input path as typing
  • pnpm run check:code-quality:changed passed against upstream/main
  • pnpm tc:web passed

How to use

  1. Open Settings → Terminal.
  2. Find Terminal Interaction (or search Scroll to Bottom on Input).
  3. Leave the switch on for the old behavior, or turn it off to keep scrollback while typing.

Demo

demo

Typing or pasting in a scrolled-up pane can keep the current viewport.
Settings > Terminal Interaction now has Scroll to Bottom on Input, on by
default, mapped to xterm's scrollOnUserInput.
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Adds a default-enabled terminal setting that controls whether typing or pasting scrolls a pane to the latest output. The setting is applied to terminal options, including dashboard previews. A searchable switch exposes the setting in terminal preferences, with localized labels, descriptions, and search terms. Tests cover setting resolution, option application, switch updates, and keeping a scrolled-up viewport pinned when scrolling on input is disabled.

Severity of issue fixed: Low

Merge Risk: Minimal · up to 4e31f

The setting is available through localized search, with no identified issue blocking merge.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description follows the repository template closely. It has all main sections: ELI5, What Changed, Why, Linked Issue, Testing, and Risk-related content, plus a demo. The Linked Issue is filled in … Add a Risk section. It should name the riskiest part (the xterm scrollOnUserInput mapping across live, new, dashboard preview, and SSH panes), give a Level (Low, Medium, or High), state what users would see if it fails, and explain how to b…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preserving terminal scroll position when the user provides input.
Linked Issues check Passed Issue [#30492] requires a Terminal setting that can disable scroll-to-bottom on input, with the default allowed to remain enabled. The PR adds terminalScrollOnUserInput, exposes “Scroll to Bottom on…
Out of Scope Changes check Passed The changes stay within issue [#30492]. The settings UI, localized text, search entry, settings type and default, terminal option mappings, preview mapping, and automated tests support the requested t…
Full details: Linked Issues check

Explanation

Issue [#30492] requires a Terminal setting that can disable scroll-to-bottom on input, with the default allowed to remain enabled. The PR adds terminalScrollOnUserInput, exposes “Scroll to Bottom on Input,” defaults it to true, and maps it to xterm scrollOnUserInput for live panes, new panes, and the dashboard preview. The reported tests cover the setting, search, defaults, pane lifecycle, xterm behavior, and preview options.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue [#30492]. The settings UI, localized text, search entry, settings type and default, terminal option mappings, preview mapping, and automated tests support the requested terminal scroll behavior. No unrelated change is demonstrated.

Full details: Description check

Explanation

The description follows the repository template closely. It has all main sections: ELI5, What Changed, Why, Linked Issue, Testing, and Risk-related content, plus a demo. The Linked Issue is filled in (Closes #30492). Testing lists automated tests, manual coverage limits, and checks run. Gaps: the template's Visual Proof section asks for a BEFORE and AFTER, but the description only gives one demo GIF and video, with no labeled before/after pair. The Risk section, required by the template, is missing entirely; it has no risk level, no statement of what could break, and no revert plan. The Review, Agent skill upstream boundary, AI Disclosure, and Checklist sections are also absent. The author states that paste, Windows/Linux, and dashboard preview were not hand-tested, so cross-platform coverage is only partly described.

Resolution

Add a Risk section. It should name the riskiest part (the xterm scrollOnUserInput mapping across live, new, dashboard preview, and SSH panes), give a Level (Low, Medium, or High), state what users would see if it fails, and explain how to back it out (plain revert; note that saved settings with terminalScrollOnUserInput would remain). Provide a clearly labeled BEFORE and AFTER visual for the interaction change, or switch to a before/after pair that can be tabbed. Add the AI Disclosure section (the template asks for it from non-team contributors), the Agent skill upstream boundary checkbox, and the Checklist. Consider stating the cross-platform and SSH impact explicitly, since the description notes that Windows, Linux, paste, and dashboard preview were not hand-tested.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a33b9d0b-1a32-41d1-9d6c-093dd227ef22
Commits

Reviewing files that changed from the base of the PR and between be83dc8 and 4e31f96.

Files selected for processing: 17
  • src/renderer/src/components/settings/TerminalInteractionSection.test.tsx
  • src/renderer/src/components/settings/setting-labels.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.test.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.ts
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/pane-manager/pane-terminal-options.ts
  • src/renderer/src/lib/pane-manager/xterm-user-scrolling-contract.test.ts
Files skipped from review as they are similar to previous changes: 12
  • src/renderer/src/components/settings/setting-labels.ts
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/es.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ffe7035-431e-410f-9bef-4e782b687297
📥 Commits

Reviewing files that changed from the base of the PR and between b03ac56 and 540a833.

📒 Files selected for processing: 16
  • src/renderer/src/components/dashboard-popout/preview-terminal-options.test.ts
  • src/renderer/src/components/dashboard-popout/preview-terminal-options.ts
  • src/renderer/src/components/settings/TerminalInteractionSection.test.tsx
  • src/renderer/src/components/settings/TerminalInteractionSection.tsx
  • src/renderer/src/components/settings/setting-labels.ts
  • src/renderer/src/components/settings/terminal-pane-appearance-search.ts
  • src/renderer/src/components/settings/terminal-search.test.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.test.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-manager-options.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/pane-manager/pane-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-terminal-options.ts
  • src/renderer/src/lib/pane-manager/xterm-user-scrolling-contract.test.ts
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread src/renderer/src/i18n/locales/en.json Resolved
Accept the removal of terminal-search.test.ts from main, which dropped that
file as low-value search coverage.
Add the label, description and search keywords to every locale catalog so
the setting does not fall back to English.
The field took global-settings-types.ts past the 300 line lint limit. Keep it
in a small settings type composed into GlobalSettingsBase, as the other
feature settings are.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 68a69ffa-10c7-4b50-b300-aa8ba2bdfcf2
Commits

Reviewing files that changed from the base of the PR and between 540a833 and d856e6c.

Files selected for processing: 21
  • src/renderer/src/components/settings/TerminalInteractionSection.tsx
  • src/renderer/src/components/terminal-pane/terminal-appearance.test.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-manager-options.ts
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/pane-manager/pane-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-terminal-options.ts
  • src/renderer/src/lib/pane-manager/xterm-user-scrolling-contract.test.ts
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-base.ts
  • src/shared/terminal-scroll-settings.ts
Files skipped from review as they are similar to previous changes: 1
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

The row passed English keywords to SearchableSetting, so a translated
query such as "einrasten" found the terminal pane but hid the row. Move
the entry to its own catalog getter and pass it to the row, so both use
the same localized keywords.
Main removed preview-terminal-options.test.ts, so keep that deletion and
drop this branch's preview assertions with it.
The changed-code quality gate rejects the type assertion.
Resolve the pane-lifecycle.test.ts conflict: main dropped the
buildDefaultTerminalOptions suite, so keep the scroll-on-input check
as its own small describe block.
@junppyo

junppyo commented Nov 3, 2026

Copy link
Copy Markdown

Hi @brennanb2025 @nwparker, could one of you take a look at this PR and merge it if it's good to go?

I'm running into this every day. I use inline TUI agents in Orca (omp, which renders into native scrollback). When I scroll up to read earlier output and start typing a follow-up, the pane jumps back to the bottom, because xterm's scrollOnUserInput is hardcoded on and no setting exposes it. This PR fixes that with an opt-out setting. The default behavior stays the same.

Where it stands:

  • MERGEABLE, no conflicts with main
  • CodeRabbit found nothing actionable on 4e31f96 and rated merge risk as minimal. Both earlier findings (locale strings, localized search keywords) are fixed and resolved.
  • CI hasn't run. PR Checks, Headless Node server, Mobile Checks, WSL orcad E2E, and PR test LoC are all waiting on maintainer approval (action_required).
  • It closes [Feature]: Option to keep the scroll position when typing in a terminal pane #30492.

Could someone approve the workflow runs and review it? Thanks!

@nwparker

nwparker commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@junppyo have you tested it out?
Could you give maybe your expereince + possibly some screenshots?

@mvanhorn that'd be nice as well 😛

If I get that, I'll merge it!

@junppyo

junppyo commented Nov 3, 2026

Copy link
Copy Markdown

@nwparker Yes, tested it locally on the PR head (07e086f) with pnpm dev on macOS arm64. I ran omp in a terminal pane in a folder workspace, asked it for 120 lines of output, scrolled up to about line 37, then
typed a follow-up.

Setting on (default): the first keystroke snaps the pane to the bottom, same as Orca today.

Scrolled up After typing one key
02-on-scrolled-up 03-on-after-typing

Setting off: I typed "Which word is on line 42?" and the text reached omp's prompt, but the view stayed on lines 37–88. I pressed Enter while still scrolled up, omp replied, and the view still didn't move.
Scrolling down showed the answer.

Setting off After typing After Enter + reply Scrolled down
04-setting-off 06-off-after-typing 08-off-after-reply-still-pinned 09-off-scrolled-down-to-reply

Turning the setting off applied to the pane that was already open, with no restart needed.

I didn't test paste, Windows/Linux, or the dashboard preview.

Thanks @mvanhorn, this fixes my daily annoyance with inline TUI agents.

@mvanhorn

mvanhorn commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@nwparker thanks for taking a look. I don't have screenshots to add beyond what @junppyo posted above, which covers the hands-on side better than I can. On my end the coverage is the unit tests in the PR: the settings section, the terminal settings search, pane lifecycle, and an xterm contract test that checks the setting reaches scrollOnUserInput on live panes, new panes and the dashboard preview. The default stays on, so nothing changes unless someone turns it off.

The CI runs are still waiting on workflow approval, so those would need a maintainer click before merge.

mvanhorn and others added 2 commits November 3, 2026 07:46
Shorten the Scroll to Bottom on Input description so it fits on one line,
widen the Terminal Interaction subtitle to cover scrolling, and add a
component fixture for the section.
@nwparker

nwparker commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Visual proof

Recorded from an e2e run that passed 3/3 times. The run prints 200 lines, scrolls up with the mouse wheel, and types echo hi. It checks the viewport position, not just the screenshots.

Setting on (default): scrolled up Setting on: after typing → snaps to prompt Setting off: after typing → stays in scrollback
on scrolled up on after typing off after typing

Video of the full run (on, then off):

scroll-on-input-demo.webm

@mvanhorn

mvanhorn commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @nwparker for recording the e2e run. It's good to see the viewport check in both directions.

@nwparker
nwparker merged commit 72b549a into stablyai:main Nov 3, 2026
95 of 97 checks passed
@mvanhorn

mvanhorn commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Appreciate the merge, @nwparker. Being able to read back through scrolled-up output while typing, without the pane jumping to the bottom, should help a lot.

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.

[Feature]: Option to keep the scroll position when typing in a terminal pane

3 participants