feat: add Ctrl+Space as unified toggle between picker and grid

Works in both directions — picker→grid and grid→picker. Keeps
existing Ctrl+` and t keybinds as alternatives.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-02-28 09:59:40 +00:00
parent bc8a0c1934
commit cad6df1a9b
2 changed files with 8 additions and 2 deletions

View File

@@ -306,7 +306,7 @@ export async function handleGridInput(rawSequence: string): Promise<boolean> {
return true return true
} }
if (rawSequence === "\x1e" || rawSequence === "\x1b`") { if (rawSequence === "\x1e" || rawSequence === "\x1b`" || rawSequence === "\x00") {
switchToPicker() switchToPicker()
return true return true
} }
@@ -397,6 +397,12 @@ function processGridInput(str: string) {
// ─── Stdin: picker mode ────────────────────────────────────────────── // ─── Stdin: picker mode ──────────────────────────────────────────────
function processPickerInput(str: string) { function processPickerInput(str: string) {
// Ctrl+Space → toggle to grid
if (str.includes("\x00") && app.directGrid && app.directGrid.paneCount > 0) {
switchToGrid()
return
}
const pickerMouse = extractMouseEvents(str) const pickerMouse = extractMouseEvents(str)
for (const me of pickerMouse) { for (const me of pickerMouse) {
if (me.btn === 0 && !me.release) handlePickerClick(me.col, me.row) if (me.btn === 0 && !me.release) handlePickerClick(me.col, me.row)

View File

@@ -93,7 +93,7 @@ export function updateColumnHeaders() {
} }
export function updateFooter() { export function updateFooter() {
const gridHint = app.directGrid && app.directGrid.paneCount > 0 ? " │ t grid" : "" const gridHint = app.directGrid && app.directGrid.paneCount > 0 ? " │ ^space grid" : ""
if (app.bottomPanelMode === "idle" && app.cachedIdleSessions.length > 0) { if (app.bottomPanelMode === "idle" && app.cachedIdleSessions.length > 0) {
app.footerText.content = t` ${dim( app.footerText.content = t` ${dim(
"↑↓ nav │ tab/shift-tab idle select │ enter focus │ i preview │ space select │ a all │ n none │ s sort │ q quit" + gridHint "↑↓ nav │ tab/shift-tab idle select │ enter focus │ i preview │ space select │ a all │ n none │ s sort │ q quit" + gridHint