feat(tui): add /session-id and /session-info slash commands#33703
Closed
EZotoff wants to merge 1 commit into
Closed
feat(tui): add /session-id and /session-info slash commands#33703EZotoff wants to merge 1 commit into
EZotoff wants to merge 1 commit into
Conversation
Add two native TUI slash commands that copy session information to the clipboard without an LLM round-trip: /session-id — copies the current session ID /session-info — copies "Project <dir>; Session <title>; ID <session-id>" Both commands appear in the slash command palette under the "Session" category and are only enabled when a session is active. Uses the existing Clipboard context and toast notification system. Supersedes anomalyco#11938 (closed by automated PR cleanup, not technical rejection). That PR covered only /session-id; this PR adds /session-info as well. Related: anomalyco#18559 (adds output.cancelled for plugin-based cancellation), anomalyco#15206 (CLI session info request), anomalyco#11937 (original feature request).
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Contributor
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two native TUI slash commands that copy session information to the system clipboard with a toast confirmation — no LLM round-trip.
/session-idses_abc123)/session-infoProject <dir>; Session <title>; ID <session-id>Both commands appear in the slash command palette under the Session category and are only enabled when a session is active (
props.sessionIDexists).Supersedes #11938 (closed by automated PR cleanup after 1 month + <2 reactions — not a technical rejection). That PR covered only
/session-id; this PR adds/session-infoas a superset that also includes the project directory and session title.Motivation
Session IDs are needed for handoff workflows, cross-session references, and manual
session_read/session_searchlookups. Currently there is no way to copy the session ID without mouse-selecting from the status bar or runningsession_listand scanning output./session-infois the broader version — copying project path + session title + ID in one operation is useful for pasting context into bug reports, PR descriptions, or team chat.Implementation
useClipboard()context (clipboard.write()) — cross-platform, noxclipdependencytoast.show()for success feedbackpackages/tui/src/component/prompt/index.tsxcommand.execute.beforehook, no throw-based abort — pure TUI command palette entriesRelated
command.execute.beforehook #18559 — addsoutput.cancelledtocommand.execute.beforefor plugin-based cancellation (complementary; would allow plugins to cleanly abort without throwing)opencode session <id>info request (different scope)Testing
bunx tsc --noEmitpasses (0 errors in modified file; pre-existing errors indialog-move-session.tsxare unrelated)Manual testing:
/session-id— session ID is copied to clipboard + toast confirms/session-info— project path, session title, and session ID are copied + toast confirmsChecklist