Summary
Add the ability to pin sessions and quickly switch between them using Alt+1 through Alt+9 keyboard shortcuts — similar to browser tab switching. Ported from upstream's session.quick_switch system.
Features
Session Pinning
- Pin/unpin sessions from the
/sessions dialog
- Pinned sessions appear at the top of the session list under a "Pinned" category
- Pin state persists across restarts (stored in
~/.local/share/cyberstrike/session.json)
Quick Switch (Alt+1-9)
- First 9 pinned sessions get slot numbers 1-9
Alt+1 switches to slot 1, Alt+2 to slot 2, etc.
- Slot numbers shown in the session list gutter
- Works from anywhere in the TUI — no need to open session list first
Implementation plan
1. local.tsx — Session namespace
Add session namespace to useLocal with the same persist pattern as model:
session.pinned() — returns pinned session IDs
session.slots() — returns first 9 pinned IDs (slot 1-9)
session.togglePin(id) — pin/unpin a session
- Persists to
~/.local/share/cyberstrike/session.json
2. keybind.tsx — Quick switch keybinds
Add 9 keybind definitions:
session_quick_switch_1: [{ key: "1", alt: true }]
...
session_quick_switch_9: [{ key: "9", alt: true }]
3. dialog-session-list.tsx — UI integration
- Pinned sessions grouped under "Pinned" category at top
- Slot numbers (1-9) shown in gutter
- Pin/unpin keybind in dialog (e.g.
ctrl+p)
4. routes/session/index.tsx — Keyboard handler
- Listen for
Alt+1-9 globally
- Navigate to
local.session.slots()[N-1] on match
References
- Upstream:
packages/tui/src/component/dialog-session-list.tsx — local.session.pinned(), local.session.slots(), slotByID gutter rendering
- Upstream:
useCommandShortcut("session.quick_switch.1") through session.quick_switch.9
Summary
Add the ability to pin sessions and quickly switch between them using
Alt+1throughAlt+9keyboard shortcuts — similar to browser tab switching. Ported from upstream'ssession.quick_switchsystem.Features
Session Pinning
/sessionsdialog~/.local/share/cyberstrike/session.json)Quick Switch (Alt+1-9)
Alt+1switches to slot 1,Alt+2to slot 2, etc.Implementation plan
1.
local.tsx— Session namespaceAdd
sessionnamespace touseLocalwith the same persist pattern asmodel:session.pinned()— returns pinned session IDssession.slots()— returns first 9 pinned IDs (slot 1-9)session.togglePin(id)— pin/unpin a session~/.local/share/cyberstrike/session.json2.
keybind.tsx— Quick switch keybindsAdd 9 keybind definitions:
3.
dialog-session-list.tsx— UI integrationctrl+p)4.
routes/session/index.tsx— Keyboard handlerAlt+1-9globallylocal.session.slots()[N-1]on matchReferences
packages/tui/src/component/dialog-session-list.tsx—local.session.pinned(),local.session.slots(),slotByIDgutter renderinguseCommandShortcut("session.quick_switch.1")throughsession.quick_switch.9