Summary
Add a toolbar to the Copilot CLI embedded terminal tool window with buttons for viewing session history, starting a new session, and (eventually) deleting sessions. This mirrors the toolbar that VS's native Copilot Chat window already has.
Motivation
VS's native Copilot Chat has three toolbar buttons in the upper-right corner:
- Circular arrow -- "View chat history"
- Speech bubble with green + overlay -- "Create new thread"
- Hamburger lines with red X overlay -- "Delete thread"
The Copilot CLI tool window currently has no toolbar at all. Adding one would let users resume previous CLI sessions without having to manually run copilot --resume, and it brings the UX closer to what VS users already expect from the native Copilot Chat.
How it could work
Copilot CLI stores all sessions in ~/.copilot/session-store.db (SQLite). Each session has a cwd (working directory) and repository field, so we can filter sessions to only show ones relevant to the current VS project.
View session history (button 1)
- Read
session-store.db in read-only mode
- Filter sessions by the current workspace path
- Show a VS-themed picker dialog listing sessions with summary and date
- Resume the selected session with
copilot --resume=<session-id>
- If no sessions exist for the workspace, show "No previous sessions for this project"
New session (button 2)
- Restart the terminal with a fresh
copilot (no --resume flag)
- Same as current restart behavior, just exposed as a toolbar button
Delete session (button 3, future)
- Could be added later. Deleting from Copilot CLI's session store needs investigation.
Implementation notes
- Toolbar defined in
.vsct with KnownMonikers icons (theme-aware, no custom bitmaps)
KnownMonikers.History for the circular arrow icon
- Toolbar associated with
TerminalToolWindow via the ToolBar property
- Session picker uses
Microsoft.VisualStudio.PlatformUI.DialogWindow for VS-native look
Microsoft.Data.Sqlite NuGet package for lightweight read-only DB access
- Gracefully handles missing DB, locked DB, and empty results
Questions
- Is adding
Microsoft.Data.Sqlite as a dependency acceptable?
- Any preference on the session picker dialog style?
Volunteering to implement
I would like to implement this and open a PR. Builds on the embedded terminal from PR #7 and the native terminal refactor in PR #8.
Summary
Add a toolbar to the Copilot CLI embedded terminal tool window with buttons for viewing session history, starting a new session, and (eventually) deleting sessions. This mirrors the toolbar that VS's native Copilot Chat window already has.
Motivation
VS's native Copilot Chat has three toolbar buttons in the upper-right corner:
The Copilot CLI tool window currently has no toolbar at all. Adding one would let users resume previous CLI sessions without having to manually run
copilot --resume, and it brings the UX closer to what VS users already expect from the native Copilot Chat.How it could work
Copilot CLI stores all sessions in
~/.copilot/session-store.db(SQLite). Each session has acwd(working directory) andrepositoryfield, so we can filter sessions to only show ones relevant to the current VS project.View session history (button 1)
session-store.dbin read-only modecopilot --resume=<session-id>New session (button 2)
copilot(no--resumeflag)Delete session (button 3, future)
Implementation notes
.vsctwithKnownMonikersicons (theme-aware, no custom bitmaps)KnownMonikers.Historyfor the circular arrow iconTerminalToolWindowvia theToolBarpropertyMicrosoft.VisualStudio.PlatformUI.DialogWindowfor VS-native lookMicrosoft.Data.SqliteNuGet package for lightweight read-only DB accessQuestions
Microsoft.Data.Sqliteas a dependency acceptable?Volunteering to implement
I would like to implement this and open a PR. Builds on the embedded terminal from PR #7 and the native terminal refactor in PR #8.