anomalyco / anomalyco/opencode

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

Open
#42,060 1 comment 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Aug 12, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.