3
43
Fork
You've already forked opencode.el
16

feat: add C-c l to list and select sessions #18

Merged
sczi merged 4 commits from daut/opencode.el:feat/list-sessions-keybinding into main 2026年01月23日 13:42:23 +01:00
Contributor
Copy link

Add opencode-list-sessions command bound to C-c l in session buffers. Shows minibuffer completion with all project sessions (excluding subagents) and time-ago annotations for quick session switching.

Inspired by OpenCode's TUI session switcher (C-x l or /session). I'm not very skilled with Elisp and developed this with AI assistance, so feedback on the implementation approach is welcome.

Add `opencode-list-sessions` command bound to `C-c l` in session buffers. Shows minibuffer completion with all project sessions (excluding subagents) and time-ago annotations for quick session switching. Inspired by OpenCode's TUI session switcher (`C-x l` or `/session`). I'm not very skilled with Elisp and developed this with AI assistance, so feedback on the implementation approach is welcome.
daut force-pushed feat/list-sessions-keybinding from ecbe9d5b0f to cee8599d4a 2026年01月23日 00:17:05 +01:00 Compare
Author
Contributor
Copy link

I'd also prefer having it open the selected session in the same window, but I wanted to get your thoughts before touching opencode-open-session since I'm still getting familiar with the codebase.

I'd also prefer having it open the selected session in the same window, but I wanted to get your thoughts before touching `opencode-open-session` since I'm still getting familiar with the codebase.
opencode-select-session to complete on all sessions from the same
proejct
opencode-select-open-session to select among already open sessions
Owner
Copy link

Looks good, I just made a couple minor changes to keep it consistent with the project:

  1. there is already a opencode--select-sessions helper function that simplifies the implementation of this
  2. rename it to opencode-select-session to be named consistent with all the other opencode-select-THING that do a completing read on THINGs and select one
  3. rename the existing opencode-select-session command to opencode-select-open-session as it only selects among open session buffers
Looks good, I just made a couple minor changes to keep it consistent with the project: 1) there is already a `opencode--select-sessions` helper function that simplifies the implementation of this 2) rename it to `opencode-select-session` to be named consistent with all the other `opencode-select-THING` that do a completing read on THINGs and select one 3) rename the existing `opencode-select-session` command to `opencode-select-open-session` as it only selects among open session buffers
Owner
Copy link

Just added an option also to control whether opencode-open-session opens in a new window or the same window, and have opencode-select-session using the same window. Also made it use same window for opencode-fork-session as at least my use of fork session is when I don't like the model's answer so I get it out of context by forking at the last good message, so I'm not interested in keeping the old session window open.

Just added an option also to control whether `opencode-open-session` opens in a new window or the same window, and have `opencode-select-session` using the same window. Also made it use same window for `opencode-fork-session` as at least my use of fork session is when I don't like the model's answer so I get it out of context by forking at the last good message, so I'm not interested in keeping the old session window open.
Owner
Copy link

any comments or looks ready to merge?

any comments or looks ready to merge?
Author
Contributor
Copy link

@sczi works like a charm feel free to merge. Thanks!

@sczi works like a charm feel free to merge. Thanks!
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sczi/opencode.el!18
Reference in a new issue
sczi/opencode.el
No description provided.
Delete branch "daut/opencode.el:feat/list-sessions-keybinding"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?