Skip to content
Open
Show file tree
Hide file tree
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
17 changes: 16 additions & 1 deletion packages/opencode/src/cli/cmd/tui/routes/session/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,21 @@ export function Session() {
dialog.clear()
},
},
{
title: (sync.data.config.tui as any)?.auto_scroll !== false ? "Disable auto-scroll" : "Enable auto-scroll",
value: "session.toggle.autoscroll",
category: "Session",
onSelect: (dialog) => {
const current = (sync.data.config.tui as any)?.auto_scroll ?? true
sdk.client.config.update({
tui: {
...sync.data.config.tui,
auto_scroll: !current,
},
})
dialog.clear()
},
},
{
title: animationsEnabled() ? "Disable animations" : "Enable animations",
value: "session.toggle.animations",
Expand Down Expand Up @@ -903,7 +918,7 @@ export function Session() {
foregroundColor: theme.border,
},
}}
stickyScroll={true}
stickyScroll={(sync.data.config.tui as any)?.auto_scroll ?? true}
stickyStart="bottom"
flexGrow={1}
scrollAcceleration={scrollAcceleration()}
Expand Down
1 change: 1 addition & 0 deletions packages/opencode/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ export namespace Config {
})
.optional()
.describe("Scroll acceleration settings"),
auto_scroll: z.boolean().optional().describe("Automatically scroll to bottom when new messages arrive"),
diff_style: z
.enum(["auto", "stacked"])
.optional()
Expand Down
4 changes: 3 additions & 1 deletion packages/web/src/content/docs/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ You can configure TUI-specific settings through the `tui` option.
"scroll_acceleration": {
"enabled": true
},
"diff_style": "auto"
"diff_style": "auto",
"auto_scroll": true
}
}
```
Expand All @@ -170,6 +171,7 @@ Available options:
- `scroll_acceleration.enabled` - Enable macOS-style scroll acceleration. **Takes precedence over `scroll_speed`.**
- `scroll_speed` - Custom scroll speed multiplier (default: `1`, minimum: `1`). Ignored if `scroll_acceleration.enabled` is `true`.
- `diff_style` - Control diff rendering. `"auto"` adapts to terminal width, `"stacked"` always shows single column.
- `auto_scroll` - Automatically scroll to bottom when new messages arrive (default: `true`).

[Learn more about using the TUI here](/docs/tui).

Expand Down
7 changes: 7 additions & 0 deletions packages/web/src/content/docs/tui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,13 @@ You can customize various aspects of the TUI view using the command palette (`ct

---

#### Auto-scroll

Toggle automatic scrolling to the bottom when new messages arrive.

- Command palette: Search for "scroll" or "auto-scroll"
- The setting persists automatically and will be remembered across TUI sessions

#### Username display

Toggle whether your username appears in chat messages. Access this through:
Expand Down