Snap To Bottom
Terminal-style snap-to-bottom for the opencode transcript
0
264
38 in 7 days
34.8
Multi-signal model
8 days ago
2026-09-04
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-snap-to-bottom@0.1.1"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-snap-to-bottom@0.1.1"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-snap-to-bottomOpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
Typing snaps the opencode transcript back to the bottom, the way a terminal treats scrollback.
opencode pins the transcript while output streams and after you submit, but once you scroll up it stays up until you scroll all the way back down. In Claude Code the transcript is the terminal's scrollback, so its behaviour is really the terminal emulator's: any keystroke jumps to the bottom, new output does not, and the scrollback keys never reach the app. This ports that rule.
Install
// ~/.config/opencode/tui.json
{ "plugin": ["opencode-snap-to-bottom"] }
Or from a checkout: { "plugin": ["./path/to/opencode-snap-to-bottom"] }.
Restart opencode afterwards.
Behaviour
Snapping fires on any keystroke except opencode's own scroll and message-navigation
commands (session.page.*, line.*, half.page.*, first, last, message.*,
messages_last_user). It identifies those by recording the dispatched command name from
the keymap dispatch event, so it follows your keybinds — rebind them and it still works.
It does nothing while a dialog is open or in modal/question mode, so the command
palette's filter is never hijacked. Landing exactly on scrollHeight - viewport.height
re-arms opencode's own sticky scroll, so follow-the-output resumes.
Options
{ "plugin": [["opencode-snap-to-bottom", { "trigger": "typing" }]] }
| Option | Default | Meaning |
|---|---|---|
trigger |
"any-key" |
Every keystroke except scroll commands (terminal-faithful). "typing" restricts it to characters actually landing in the prompt. |
paste |
true |
Also snap when pasting into the prompt. |
Verified against opencode 1.18.27
| Case | Result |
|---|---|
| Scroll up, type one character | Snaps to bottom |
| PageUp / PageDown | Still scroll freely |
Home (jump to first message) |
Stays at top |
| Esc, ↑ history recall | Snap |
| Palette open, typing a filter | Transcript stays put |
| Typing while already at bottom | No-op |
Finding the transcript: it is the only scrollbox in the TUI with
stickyScroll && stickyStart === "bottom", which makes that a stable discriminator —
the sidebar, dialogs, autocomplete and diff viewer all have non-sticky scrollboxes.
Similar plugins
Fold Diffs
opencode-fold-diffs
OpenCode TUI plugin: write, edit, apply_patch and long bash commands render folded to their title line, click or ctrl+o to open them.
Tui
@skwid138/opencode-tui
Configurable TUI plugin for OpenCode — custom logo and prompt placeholders
Double Ctrl C
opencode-double-ctrl-c
OpenCode TUI plugin: press ctrl+c twice to exit, replicating Claude Code and Codex CLI. One press clears the prompt; on an empty prompt it asks for a second press instead of quitting.