pi-mono/packages/coding-agent/src/cli
robopipi[bot] b0c64f33c8
fix(coding-agent): load user keybindings in pi config (#11788)
`pi config` ignored `~/.pi/agent/keybindings.json`. `selectConfig()`
never called `setKeybindings()`, so the config selector's
`getKeybindings()` fell back to the default TUI bindings. Remaps such as
`"tui.select.down": ["down", "ctrl+n"]` did nothing there, although they
work in `/settings` and the `--resume` picker.

`selectConfig()` now installs
`KeybindingsManager.create(options.agentDir)` before it builds the UI,
the same way the session picker and startup UI do.

**Testing**
- Added `test/config-selector-keybindings.test.ts`. It runs
`selectConfig()` with a stubbed terminal and component and an agent dir
whose `keybindings.json` remaps `tui.select.up` and `tui.select.down`,
then checks that the active keybindings include `ctrl+p` and `ctrl+n`.
It fails without the change and passes with it.
- Manual check: ran `pi config` in tmux with that `keybindings.json`.
Before the change, Ctrl+N did nothing. After it, Ctrl+N moves the
selection like Down.
- `npm run check` reports only two errors, both missing modules in
`packages/schema/test/bench/candidates.ts`. They occur on `main` without
this change.

Fixes #11651

Requested by @badlogic

Co-authored-by: triagent <triagent@localhost>
2026-11-04 09:59:49 +01:00
..
args.ts feat(coding-agent): add PI_SELF_UPDATE_COMMAND and selfUpdateCommand for pi update (#11629) 2026-10-30 22:30:39 +01:00
auth-check.ts feat(coding-agent): add auth preflight 2026-08-06 19:43:52 +02:00
auth-command.ts fix(coding-agent): use APP_NAME in user-facing messages (#8067) 2026-08-14 11:26:20 +02:00
config-selector.ts fix(coding-agent): load user keybindings in pi config (#11788) 2026-11-04 09:59:49 +01:00
credential-print.ts fix(coding-agent): resolve model references through one provider selection policy (#10913) 2026-10-14 11:00:21 +01:00
file-processor.ts feat(ai,coding-agent): add image input limits (closes #9631) 2026-09-20 22:59:16 +02:00
initial-message.ts chore(ts): use source import extensions 2026-05-20 00:04:03 +02:00
list-models.ts fix(coding-agent): make model refresh cancellation caller-owned 2026-08-04 00:03:52 +02:00
project-trust.ts feat(ui): Improved project approval settings 2026-06-09 13:25:54 +02:00
session-picker.ts feat(coding-agent): load session picker progressively 2026-09-20 00:48:26 +02:00
setup.ts fix(coding-agent): keep remote harness dependencies development-only 2026-09-05 12:45:04 +02:00
startup-ui.ts feat(coding-agent,tui): System theme (#10067) 2026-09-26 13:33:47 +02:00