Skip to content

Commit 3cdd431

Browse files
authored
fix(tui): make move session command bindable (#33508)
Add the session_move TUI keybind and map it to the existing session.move command. Keep it unbound by default and document the new configuration option. Closes #33239
1 parent ef4500d commit 3cdd431

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎packages/tui/src/config/keybind.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export const Definitions = {
8383

8484
session_export: keybind("<leader>x", "Export session to editor"),
8585
session_copy: keybind("none", "Copy session transcript"),
86+
session_move: keybind("none", "Move session"),
8687
session_new: keybind("<leader>n", "Create a new session"),
8788
session_list: keybind("<leader>l", "List all sessions"),
8889
session_timeline: keybind("<leader>g", "Show session timeline"),
@@ -287,6 +288,7 @@ export const CommandMap = {
287288
status_view: "opencode.status",
288289
session_export: "session.export",
289290
session_copy: "session.copy",
291+
session_move: "session.move",
290292
session_new: "session.new",
291293
session_list: "session.list",
292294
session_timeline: "session.timeline",

‎packages/tui/test/config.test.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ test("resolves overrides without mutating input", () => {
8080
expect(input.keybinds).toEqual({ session_list: "ctrl+l" })
8181
})
8282

83+
test("resolves a session move keybind", () => {
84+
const config = resolve({ keybinds: { session_move: "ctrl+o" } }, { terminalSuspend: true })
85+
86+
expect(config.keybinds.get("session.move")).toMatchObject([{ key: "ctrl+o" }])
87+
})
88+
8389
test("disables suspend and assigns ctrl+z to undo when unsupported", () => {
8490
const config = resolve({}, { terminalSuspend: false })
8591

‎packages/web/src/content/docs/keybinds.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ OpenCode has a list of keybinds that you can customize through `tui.json`.
3434

3535
"session_export": "<leader>x",
3636
"session_copy": "none",
37+
"session_move": "none",
3738
"session_new": "<leader>n",
3839
"session_list": "<leader>l",
3940
"session_timeline": "<leader>g",

0 commit comments

Comments
 (0)