Skip to content

Conversation

@w-winter
Copy link
Contributor

@w-winter w-winter commented Jan 20, 2026

Originating issue: #862

The /resume picker already supports search, scope toggling, and sort modes, but named sessions can get lost easily sometimes. This adds a Ctrl+N toggle to filter the list down to sessions named via /name, while keeping the existing search/sort behavior intact (name filtering applies even when the query is empty).

Summary of changes:

  • add NameFilter (all | named) to filterAndSortSessions() and apply it before query parsing/matching
  • add Ctrl+N in the session selector to toggle Name: AllName: Named, and show current state in the header
  • improve empty-state messaging when the named filter is active (including the escape hatch key)
  • tests: add name filter coverage (incl. whitespace-only names excluded via trim())
  • add configurable app keybinding toggleSessionNamedFilter (default: ctrl+n) via ~/.pi/agent/keybindings.json
  • session selector now uses KeybindingsManager for the named-filter toggle and UI hints/empty-state messaging, so users can remap it (e.g. for Emacs/readline ctrl+n = down)

Files:

  • packages/coding-agent/README.md
  • packages/coding-agent/src/cli/session-picker.ts
  • packages/coding-agent/src/core/keybindings.ts
  • packages/coding-agent/src/modes/interactive/components/session-selector-search.ts
  • packages/coding-agent/src/modes/interactive/components/session-selector.ts
  • packages/coding-agent/src/modes/interactive/interactive-mode.ts
  • packages/coding-agent/test/session-selector-path-delete.test.ts
  • packages/coding-agent/test/session-selector-search.test.ts

Manual testing:

  • /resume: Ctrl+N toggles All/Named; header updates; hint shows ctrl+n: named
  • /resume: named filter works with empty search query and with an active query
  • /resume: empty state mentions Ctrl+N when no named sessions are available in the current scope
  • /resume: named filter toggle works; header updates; hint shows the configured keybinding
  • keybindings.json: remapping toggleSessionNamedFilter works (e.g. free up ctrl+n for selectDown)

all named

}

// Ctrl+N: toggle name filter
if (matchesKey(keyData, "ctrl+n")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this configurable :-) I rebind ctrl+n in session picker for "select down". Here's part of my keybindings:

  "selectUp": ["up", "ctrl+p"],
  "selectDown": ["down", "ctrl+n"],

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are just standard Emacs/readline keybindings btw

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. The named-only toggle is now configurable via ~/.pi/agent/keybindings.json:

{
  "toggleSessionNamedFilter": "whatever"
}

@badlogic Do you want a follow-up that makes the other /resume picker shortcuts configurable too (ctrl+r sort, ctrl+p path toggle, ctrl+d delete), or should we those hardcoded?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants