From 653b7d79cd333a0f391cc14175feeb7075d11254 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Wed, 12 Aug 2026 11:57:39 -0400 Subject: [PATCH] fix(tui): restore navigation keybind defaults (#42066) --- packages/tui/src/config/keybind.ts | 26 +++++++++++++++----------- packages/tui/test/config-v2.test.tsx | 19 +++++++++++++++++++ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/packages/tui/src/config/keybind.ts b/packages/tui/src/config/keybind.ts index bef9a0f0539..be007d182a1 100644 --- a/packages/tui/src/config/keybind.ts +++ b/packages/tui/src/config/keybind.ts @@ -96,13 +96,15 @@ export const Definitions = { "session.move": keybind("none", "Move session"), "session.new": keybind("n", "Create a new session"), "session.list": keybind("l", "List all sessions"), - "session.tab.next": keybind("ctrl+tab,right", "Switch to next open session tab"), - "session.tab.previous": keybind("ctrl+shift+tab,left", "Switch to previous open session tab"), - "session.tab.history.back": keybind("ctrl+o", "Go back in session tab history"), + "open.menu": keybind("ctrl+o", "Open recent sessions and projects"), + "session.tab.next": keybind("ctrl+tab,alt+down", "Switch to next open session tab"), + "session.tab.previous": keybind("ctrl+shift+tab,alt+up", "Switch to previous open session tab"), + "session.tab.history.back": keybind("none", "Go back in session tab history"), "session.tab.history.forward": keybind("ctrl+i", "Go forward in session tab history"), - "session.tab.next_unread": keybind("down", "Switch to next unread session tab"), - "session.tab.previous_unread": keybind("up", "Switch to previous unread session tab"), + "session.tab.next_unread": keybind("alt+shift+down", "Switch to next unread session tab"), + "session.tab.previous_unread": keybind("alt+shift+up", "Switch to previous unread session tab"), "session.tab.close": keybind("w", "Close current session tab"), + "session.tab.reopen": keybind("ctrl+shift+t", "Reopen last closed session tab"), "session.timeline": keybind("g", "Show session timeline"), "session.fork": keybind("none", "Fork session from message"), "session.rename": keybind("ctrl+r", "Rename session"), @@ -139,6 +141,7 @@ export const Definitions = { "session.tab.select.7": keybind("7,ctrl+7", "Switch to session tab 7"), "session.tab.select.8": keybind("8,ctrl+8", "Switch to session tab 8"), "session.tab.select.9": keybind("9,ctrl+9", "Switch to session tab 9"), + "session.tab.select.10": keybind("0,ctrl+0", "Switch to session tab 10"), "stash.delete": keybind("ctrl+d", "Delete stash entry"), "model.dialog.provider": keybind("ctrl+a", "Open provider list from model dialog"), @@ -164,10 +167,10 @@ export const Definitions = { "session.half.page.down": keybind("ctrl+alt+d", "Scroll messages down by half page"), "session.first": keybind("ctrl+g,home,alt+home", "Navigate to first message"), "session.last": keybind("ctrl+alt+g,end", "Navigate to last message"), - "session.message.next": keybind("alt+down", "Navigate to next message"), - "session.message.previous": keybind("alt+up", "Navigate to previous message"), - "session.message.user.next": keybind("alt+shift+down", "Navigate to next user message"), - "session.message.user.previous": keybind("alt+shift+up", "Navigate to previous user message"), + "session.message.next": keybind("none", "Navigate to next message"), + "session.message.previous": keybind("none", "Navigate to previous message"), + "session.message.user.next": keybind("none", "Navigate to next user message"), + "session.message.user.previous": keybind("none", "Navigate to previous user message"), "session.messages_last_user": keybind("alt+end", "Navigate to last user message"), "messages.copy": keybind("y", "Copy message"), "session.undo": keybind("u", "Undo message"), @@ -177,6 +180,7 @@ export const Definitions = { "prompt.submit": keybind("none", "Submit prompt"), "prompt.queue": keybind("alt+return", "Queue prompt"), "prompt.editor_context.clear": keybind("none", "Clear editor context"), + "prompt.images.view": keybind("i", "View image attachments"), "prompt.skills": keybind("none", "Open skill selector"), "prompt.stash": keybind("none", "Stash prompt"), "prompt.stash.pop": keybind("none", "Pop stashed prompt"), @@ -202,8 +206,8 @@ export const Definitions = { "input.visual.line.end": keybind("alt+e", "Move to end of visual line in input"), "input.select.visual.line.home": keybind("alt+shift+a", "Select to start of visual line in input"), "input.select.visual.line.end": keybind("alt+shift+e", "Select to end of visual line in input"), - "input.buffer.home": keybind("home", "Move to start of buffer in input"), - "input.buffer.end": keybind("end", "Move to end of buffer in input"), + "input.buffer.home": keybind("none", "Move to start of buffer in input"), + "input.buffer.end": keybind("none", "Move to end of buffer in input"), "input.select.buffer.home": keybind("shift+home", "Select to start of buffer in input"), "input.select.buffer.end": keybind("shift+end", "Select to end of buffer in input"), "input.delete.line": keybind("ctrl+shift+d", "Delete line in input"), diff --git a/packages/tui/test/config-v2.test.tsx b/packages/tui/test/config-v2.test.tsx index 55965adcd9c..57a1c2858d8 100644 --- a/packages/tui/test/config-v2.test.tsx +++ b/packages/tui/test/config-v2.test.tsx @@ -74,6 +74,25 @@ test("uses command IDs as keybind keys", () => { ).toBe(true) }) +test("preserves current navigation defaults", () => { + const config = resolve({}, { terminalSuspend: true }) + + expect(config.keybinds.get("open.menu")).toMatchObject([{ key: "ctrl+o" }]) + expect(config.keybinds.get("session.tab.next")).toMatchObject([{ key: "ctrl+tab,alt+down" }]) + expect(config.keybinds.get("session.tab.previous")).toMatchObject([{ key: "ctrl+shift+tab,alt+up" }]) + expect(config.keybinds.get("session.tab.next_unread")).toMatchObject([{ key: "alt+shift+down" }]) + expect(config.keybinds.get("session.tab.previous_unread")).toMatchObject([{ key: "alt+shift+up" }]) + expect(config.keybinds.get("session.tab.reopen")).toMatchObject([{ key: "ctrl+shift+t" }]) + expect(config.keybinds.get("session.tab.select.10")).toMatchObject([{ key: "0,ctrl+0" }]) + expect(config.keybinds.get("session.message.next")).toEqual([]) + expect(config.keybinds.get("session.message.previous")).toEqual([]) + expect(config.keybinds.get("session.message.user.next")).toEqual([]) + expect(config.keybinds.get("session.message.user.previous")).toEqual([]) + expect(config.keybinds.get("input.buffer.home")).toEqual([]) + expect(config.keybinds.get("input.buffer.end")).toEqual([]) + expect(config.keybinds.get("prompt.images.view")).toMatchObject([{ key: "i" }]) +}) + test("preserves migrated v1 keybind defaults", () => { const pairs = [ ["app.exit", "app_exit"],