GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tui: /sessions drops pinned sessions outside the listed page and Ctrl+F no longer follows the pinned row · Issue #66534 · anomalyco/opencode

tui: /sessions drops pinned sessions outside the listed page and Ctrl+F no longer follows the pinned row #66534

New issue
Copy link
New issue
Copy link
Backlog
Backlog
tui: /sessions drops pinned sessions outside the listed page and Ctrl+F no longer follows the pinned row#66534
Copy link
Labels
area/tuiTerminal interfaceplatform/windowsWindowsreproducedtype/bugSomething is brokenversion/v2OpenCode 2.x

Description

@troy818
troy818
opened on Nov 26, 2026
Issue body actions

Summary

After upgrading from 1.19.0 to 2.4.2, the TUI /sessions dialog loses two pin behaviors that 1.x had: pinned sessions outside the current page of results no longer appear (with their quick-switch numbers), and pressing ctrl+f (session.pin.toggle) no longer moves the cursor with the pinned row.

Environment

  • opencode version: 2.4.2 (upgraded from 1.19.0, opencode-ai -> @opencode/cli)
  • Client: TUI
  • Model and provider: Not relevant
  • OS: Windows 11 (Windows_NT 10.0.26200, x64)
  • Terminal: herdr (HERDR_ENV=1, so tabs.mode: auto resolves to tabs off and the Pinned group is active)
  • Shell: cmd.exe
  • Install/channel: npm global, latest
  • Active plugins: no CLI plugins in cli.json; two local server plugins that only report session state to herdr

Reproduction

A. Pinned sessions disappear

  1. Pin sessions in several directories (in 1.x or 2.x). ~/.local/state/opencode/session.json has 12 entries.
  2. Open /sessions in one project directory.
  3. Only the 4 pinned sessions that belong to the current directory appear under Pinned. The other 8 (other directories) are gone, along with their 1-9 quick-switch numbers.
  4. ctrl+a (all projects) makes it worse: the list is the 50 most recent sessions across all projects, so only 2 of the 12 pins appear (the others rank 56 to 587 by update time).

B. Cursor does not follow the pinned row

  1. Open /sessions and move the cursor to an unpinned session lower in the list.
  2. Press ctrl+f.
  3. The session moves into Pinned at the top, but the cursor stays on the same row index, now on a different session. Pressing ctrl+f again unpins/pins whatever is under the cursor.

Expected Behavior

As in 1.19.x:

  • A. Pinned sessions are always listed under Pinned regardless of the list scope or page limit (1.x appended pinned IDs from synced data as extra when they were not in the query result).
  • B. After pin/unpin the selection follows the toggled session (1.x passed preserveSelection={true}).

Actual Behavior

In packages/tui/src/component/dialog-session-list.tsx at v2.4.2:

  • pinned = local.session.pinned().filter((id) => sessionMap.has(id)), and sessionMap only contains the current search/list result (limit: 50, current directory unless ctrl+a). Pins outside that set are dropped. local.session.slots() similarly only keeps pins present in data.session.list().
  • DialogSelect is rendered with focusCurrent={false} and without preserveSelection, so the props.options effect in ui/dialog-select.tsx takes the reconcileSelection(store.selected, count) path and keeps the index instead of the value.

Additional Context

  • Related: V2 TUI: add fast session overview and pinned session shortcuts #36193 (V2 TUI pinned session shortcuts), [FEATURE]: show pinned sessions in the session list when tabs are enabled #60236 (pinned sessions when tabs are enabled). This report is about the tabs-off path, where the Pinned group still exists.
  • No workaround found for A or B.
  • Pin state in session.json survived the upgrade intact; this is display/selection only.

Activity

  1. opencodejr
    added
    area/tuiTerminal interface
    platform/windowsWindows
    type/bugSomething is broken
    version/v2OpenCode 2.x
    on Nov 26, 2026
  2. opencodejr commented on Nov 26, 2026

    @opencodejr
    opencodejrBot
    on Nov 26, 2026
    Contributor
    More actions

    Thanks for the detailed report. I reproduced the cursor problem (part B) on 2.4.2 with tabs off:

    1. With five sessions listed (E, D, C, B, A), I moved the cursor to session-B and pressed ctrl+f.
    2. session-B moved under Pinned, but the highlight stayed on the 4th row, which was now session-C.
    3. Pressing ctrl+f again pinned session-C instead of unpinning session-B.

    It still happens on the latest dev (44344bd). The recording and screenshots below show it, and the script below reproduces it.

    I did not run part A (pins outside the loaded page or from other directories) here. It is tracked in #60236, which has PR #60237 open; #64337 (the same report on 2.2.6) was closed as a duplicate of it. Open PR #64339 also restores older pins, but only those in the selected scope, so pins from other directories would still be hidden in the current-directory view.

    https://anoma.ly/team/github-bot/media/1de7e20ed43c2bfc08e822f24793efebd9325ced63390eb2bcbb6c614d550448.mp4

    Screenshot

    Screenshot

    Screenshot

    Reproduction script (drive.ts)
    // Reproduces anomalyco/opencode#66534 (part B): after ctrl+f (pin) in /sessions,
    // the cursor stays on the same row index instead of following the pinned session.
    import { Effect } from "effect"
    import { OpenCodeDriver } from "opencode-drive"
    
    const TITLES = ["session-A", "session-B", "session-C", "session-D", "session-E"]
    
    export default OpenCodeDriver.use(
      {
        ...(process.env.OC_DEV ? { opencode: { dev: process.env.OC_DEV } } : {}),
        tuiConfig: { tabs: { mode: "off" } },
        tui: { recording: true, keypressOverlay: true, viewport: { cols: 140, rows: 40 } },
      } as any,
      ({ ui, opencode }) =>
        Effect.gen(function* () {
          for (const title of TITLES) {
            yield* opencode.session.create({ title })
            yield* Effect.sleep(100)
          }
          yield* Effect.sleep(3000)
          yield* ui.screenshot("0-home")
          yield* ui.type("/sessions")
          yield* Effect.sleep(500)
          yield* ui.screenshot("0b-typed")
          yield* ui.enter()
          yield* Effect.sleep(1500)
          yield* ui.screenshot("0c-after-enter")
          yield* ui.waitFor("Search sessions", { timeout: 15000 } as any)
          yield* Effect.sleep(800)
          if (yield* ui.matches("Search sessions in")) yield* ui.press("a", { ctrl: true })
          yield* ui.waitFor("session-A")
          yield* Effect.sleep(800)
          yield* ui.screenshot("1-list")
          // Move the cursor down to the 4th row (session-B, list is newest first: E D C B A)
          for (let i = 0; i < 3; i++) {
            yield* ui.arrow("down")
            yield* Effect.sleep(200)
          }
          yield* Effect.sleep(500)
          yield* ui.screenshot("2-cursor-on-session-B")
          // Pin it
          yield* ui.press("f", { ctrl: true })
          yield* Effect.sleep(1000)
          yield* ui.screenshot("3-after-pin")
          // Press ctrl+f again: if the cursor followed, this unpins session-B.
          yield* ui.press("f", { ctrl: true })
          yield* Effect.sleep(1000)
          yield* ui.screenshot("4-after-second-ctrl-f")
          yield* Effect.sleep(500)
        }),
    )

    Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.

  3. opencodejr
    added
    reproduced
    on Nov 26, 2026
  4. troy818 commented on Nov 26, 2026

    @troy818
    troy818
    on Nov 26, 2026
    Author
    More actions

    Follow-up: after restarting the TUI (tabs off, pins in the current directory present in the list), no pinned session shows a quick-switch number at all, and <leader>1..<leader>9 do nothing.

    Cause, as far as I can tell from v2.4.2 source:

    • local.session.slots() (packages/tui/src/context/local.tsx) keeps only pins that are present in data.session.list().
    • data.session.list() (packages/client/src/solid/data.ts) is Object.values(store.session.info), and store.session.info is only filled by session.sync(id) / remember(info) / events, i.e. sessions that were opened, created, or seen running during this TUI run. The /sessions dialog's api.session.list result is never written into that store.
    • So on a fresh start, unless a pinned session was opened in this run, slots() is empty: no gutter numbers, no switch footer hint, and the quick-switch commands resolve to nothing. In 1.19, sync.data.session held the listed sessions, so every pin got a slot.

    Expected: slots are derived from the pin list itself (the first 9 pins), with pinned sessions fetched by ID when not loaded, so numbers are stable across restarts and directories.

  5. LyleLiu666 commented on Nov 26, 2026

    @LyleLiu666
    LyleLiu666
    on Nov 26, 2026
    More actions

    I tested #64339 and #60237 on the same dev baseline. #64339 restores older pins in the selected scope, and #60237 shows the Pinned group with tabs enabled and loads saved pins when the picker opens.

    The second Ctrl+F still toggles a different session in both. Neither restores the number shortcut directly from Home after restart. This tested patch covers those two paths. Would a separate follow-up for them be useful?

  6. Guembri01 commented on Nov 27, 2026

    @Guembri01
    Guembri01
    on Nov 27, 2026
    More actions

    Fixed the first half, and verified the second is already working.

    Pinned sessions outside the page. /sessions built Pinned only from the query result:

    const pinned = sessionTabs.enabled() ? [] : local.session.pinned().filter((sessionID) => sessionMap.has(sessionID))

    so a pin outside the /api/session page disappeared — other directories with the directory scope, and anything past the 50-result page with all projects on, which is the 8 of 12 you saw. A pin the query did not return is now taken from the synced store (data.session.get), and is still dropped when a search is active and it does not match.

    Cursor after ctrl+f. That is covered by the existing pin toggle keeps the cursor on the toggled session test in dialog-session-list-actions.test.tsx, and it passes on current dev: DialogSelect re-finds the selected row by value when the options reorder, so the cursor lands on the toggled session. Nothing needed changing for it.

    The new test seeds session.json with a pin whose session the page does not return and asserts the row renders: with the component reverted the frame never contains it (times out); with the change it sits above the page's session. The two dialog test files are 5 pass, 0 fail, and packages/tui typechecks.

    Branch session-list-pinned-page at bccda28 is pushed with the body written. PR creation is returning 404 for this account again (one PR did open earlier today), so it waits as a branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/tuiTerminal interfaceplatform/windowsWindowsreproducedtype/bugSomething is brokenversion/v2OpenCode 2.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.