Skip to content

Conversation

@jeanlaurent
Copy link
Member

@jeanlaurent jeanlaurent commented Oct 16, 2025

The only way to copy from the clipboard is through CMD-P then select copy.
This adds /copy, /reset and /compact` commands in all modes (including --tui=false).

Fixes #517

Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
@jeanlaurent jeanlaurent requested a review from a team as a code owner October 16, 2025 09:56
@krissetto
Copy link
Contributor

Is this supposed to resolve #517? I'm not sure if /copy and /clipboard have the same meaning or if I'm missing some other detail

@jeanlaurent
Copy link
Member Author

Yes /clipboard might not be the best named function


// handleSlashCommand checks if the content is a slash command and handles it
// Returns (true, cmd) if command was handled, (false, nil) otherwise
func (p *chatPage) handleSlashCommand(content string) (bool, tea.Cmd) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These commands already exist in the tui.go

cagent/pkg/tui/tui.go

Lines 293 to 333 in 6055909

func (a *appModel) buildCommandCategories() []dialog.CommandCategory {
return []dialog.CommandCategory{
{
Name: "Session",
Commands: []dialog.Command{
{
ID: "session.new",
Label: "New ",
Description: "Start a new conversation",
Category: "Session",
Execute: func() tea.Cmd {
a.application.NewSession()
a.chatPage = chatpage.New(a.application)
a.dialog = dialog.New()
a.statusBar = statusbar.New(a.chatPage)
return tea.Batch(a.Init(), a.handleWindowResize(a.wWidth, a.wHeight))
},
},
{
ID: "session.compact",
Label: "Compact",
Description: "Summarize the current conversation",
Category: "Session",
Execute: func() tea.Cmd {
return a.chatPage.CompactSession()
},
},
{
ID: "session.clipboard",
Label: "Copy",
Description: "Copy the current conversation to the clipboard",
Category: "Session",
Execute: func() tea.Cmd {
return a.chatPage.CopySessionToClipboard()
},
},
},
},
}
}

We should reuse them

@rumpl rumpl changed the title reintroduce the /copy command Slash commands Oct 20, 2025
@dgageot
Copy link
Member

dgageot commented Oct 25, 2025

@jeanlaurent @rumpl What's the status on this one?

@dgageot
Copy link
Member

dgageot commented Oct 29, 2025

@jeanlaurent I'm going to close this one. There are other PRs that try to address that

@dgageot dgageot closed this Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add / commands to the TUI

5 participants