Skip to content

TUI: session directory filter keybind is inactive inside the session picker #42060

Closed

Description

@thepigdestroyer

What happened

A key bound to app.toggle.session_directory_filter does nothing while the session picker is open. The same key works from the main screen.

The default for this keybind is none, so only users who bind it hit this.

Steps to reproduce

  1. Put this in tui.json:
    { "keybinds": { "app_toggle_session_directory_filter": "ctrl+a" } }
  2. On the main screen, press ctrl+a. The filter toggles, as expected.
  3. Open the session picker (session.list), press ctrl+a. Nothing happens.

Cause

app.toggle.session_directory_filter is in appBindingCommands, and that list is gathered under a mode:

useBindings(() => ({
  mode: OPENCODE_BASE_MODE,
  bindings: tuiConfig.keybinds.gather("app", appBindingCommands),
}))

Opening a dialog pushes "modal" (packages/tui/src/ui/dialog.tsx), so that whole layer goes inactive. The session picker is a dialog.

Confirmed by pushing the mode directly in a test: getOpencodeModeStack(keymap).push("modal") takes the command from 1 active binding to 0.

Expected

The toggle decides which sessions the picker lists, so it should be reachable while the picker is open. appGlobalBindingCommands is gathered without a mode and already holds session.list and the quick-switch commands for this reason.

Second, smaller problem

The command ends with an unconditional dialog.clear(). If it is triggered while the picker is open, the picker closes, so you cannot see the result of the toggle. The picker's resource queries on sync.session.query(), so it re-lists in place if left open.

I have a fix for both and will link a PR.

Activity

  1. github-actions commented on Aug 12, 2026

    @github-actions
    Contributor

    For keybind-related issues, please also check our pinned keybinds documentation: #4997

  2. Mattheinrichs commented on Sep 21, 2026

    @Mattheinrichs

    Re-submitting the fix from #42056 as a fresh PR: #50432

    That PR was closed by the automated cleanup (created >1 month, <2 reactions), not on the merits. Same approach: move app.toggle.session_directory_filter out of the base-mode bindings so it stays active while the picker dialog is open, plus a footer hint showing the current scope (#42058).

    Original fix by @thepigdestroyer.

  3. neriousy commented on Oct 19, 2026

    @neriousy
    Member

    In v2, press Ctrl+A inside the session picker to switch between current-directory and all-project sessions. The results update in place and the picker stays open. To get v2: npm i -g @opencode/cli@latest or curl -fsSL https://opencode.ai/v2/install | bash (desktop: update the app). If you still see this on v2, please open a new issue with the details.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions