mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 15:03:31 +00:00
The problem: I wanted to be able to select my session (either from `/resume` or `--resume`) with different keybindings. The issue: when running `pi --resume`, custom keybindings from `~/.pi/agent/keybindings.json` were not being applied to the session picker. This happened because `KeybindingsManager.create()` was only called when `InteractiveMode` initialized, but the session picker runs before that in `main.ts`. The session picker uses `getEditorKeybindings()` for navigation (selectUp/selectDown etc.), which returns the global default keybindings if `setEditorKeybindings()` hasn't been called yet. Fix: Call `KeybindingsManager.create()` inside the `--resume` block before showing the session picker. This loads user keybindings and sets them globally. The current fix results in double-init of keybindings when entering interactive mode which _should_ be harmless, since it's the same same config loaded twice, but is minimal and only affects the `--resume` path. I considered passing keybindings from `main()` to `InteractiveMode` - it's cleaner but requires API changes. Also documented the `select*` keybindings in README.md. |
||
|---|---|---|
| .. | ||
| agent | ||
| ai | ||
| coding-agent | ||
| mom | ||
| pods | ||
| tui | ||
| web-ui | ||