fix(terminal): Jump to Latest works in OpenCode Terminal panes (#843) - #1043
Merged
Merged
Conversation
Only source and test changes, so package.json and the lockfile are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
#843) - The follow hook asks the provider to jump exactly once per new request, and never for the baseline a mount or session switch takes. - SessionManager routes the request to a session that implements jumpToLatest, answers unsupported for one that does not, and answers no-session for an unknown id. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
OpenCode's TUI pages its transcript on the alternate screen, so xterm's scrollToBottom, the whole of Jump to Latest, could never move it. Its chord was tried and reverted, because the binding is user-configurable and a destructive action can sit on it. A new optional AgentSession.jumpToLatest is reached through a fixed IPC request (session:jumpToLatest), never a command string from the renderer. OpencodeTerminalSession implements it through the package's jumpToLatest, which runs messages_last on the TUI's own authenticated server below the keybind layer. That was proven live against the installed 1.18.31 in the package's opt-in test, where session.last is accepted and ignored. The follow hook still scrolls xterm for inline TUIs and shells, and every other provider answers unsupported. The command's description no longer tells OpenCode users to use their own keys. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CI caught it: AgentTerminalLeaf suites stub window.api without the new jumpToLatest. The call threw inside the follow effect and broke the pane's other follow behaviour (tail, pinning). It is optional-called now, because a bridge without the method must not cost a pane its scrolling. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
# Conflicts: # src/main/sessionManager.screenGate.test.ts
Juliusolsson05
added a commit
that referenced
this pull request
Sep 19, 2026
…1047 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 2 of #843. Part 1, the mouse wheel after a remount, is #1041.
Why
OpenCode's TUI pages its transcript inside its own scrollbox on the alternate screen. xterm's
scrollToBottom, which was all Jump to Latest did, could never move it.The TUI's chord (Ctrl+Alt+G =
messages_last) was tried and reverted: keybinds are user-configurable, and a supported config can putmessages_undo(abort and revert) on that chord. Seedocs/superpowers/research/2026-09-08-post-merge-regression-audit.mdD1.Change
jumpToLatest()./tui/execute-command {"command":"messages_last"}to the TUI's own authenticated server, below the keybind layer.session.lastis accepted with 200 and does nothing. The route answers 200 for any string, so only the live test can tell the two apart.AgentSession.jumpToLatest(),SessionManager.jumpToLatest, IPCsession:jumpToLatest, and preload.OpencodeTerminalSessionimplements it.useTerminalFollowcallsonJumpToLatestonce per new request (never for a mount or session-switch baseline), next to the existingscrollToBottom.unsupportedfor them.Tests
terminalFollow.jump.renderer.test.tsx: exactly one provider jump per new request, none on mount or session switch.sessionManager.screenGate.test.ts: routed to a session that implements it,unsupportedotherwise,no-sessionfor an unknown id.OpencodeTerminalHeadless.live.test.ts, opt-in.npx tsc -bis clean.🤖 Generated with Claude Code