Skip to content

Enable terminal chat message copy #19009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: feature/llm
Choose a base branch
from

Conversation

jamespack
Copy link
Contributor

Summary of the Pull Request

This pull request enables copying terminal chat messages from AI Suggesstions.

References and Relevant Issues

#17941

Detailed Description of the Pull Request / Additional comments

Enables both keyboard copy with ctrl+c and mouse copy with a context menu.

Validation Steps Performed

This was tested locally on my machine. Both functions verified to work.

PR Checklist

This comment has been minimized.

@jamespack
Copy link
Contributor Author

image

@jamespack jamespack closed this Jun 7, 2025
@jamespack jamespack reopened this Jun 7, 2025

This comment has been minimized.

@jamespack jamespack marked this pull request as draft June 7, 2025 17:42
@jamespack jamespack marked this pull request as ready for review June 7, 2025 17:43
Copy link
Contributor

@PankajBhojwani PankajBhojwani left a comment

Choose a reason for hiding this comment

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

Played around with the branch, looks and feels great! Thank you for the contribution

Not a blocker (and I'm not even sure if it's possible but I think it's worth investigating) but I wonder if the "Copy" option should show up even if there's no selection in the bubble (i.e. so we interpret that as "copy the entire message"). That way if a user wants to copy the whole thing they don't need to first click "Select All" and then right click again and click "Copy". This is what happens right now when you right-click without selecting anything first:

Image

Approving anyway since right-click->"Select all"->right-click->"Copy" is still a fairly straightforward way to copy the entire thing, but if you can investigate whether copying the entire thing with the first right-click is possible that'll be great :)

@jamespack
Copy link
Contributor Author

That's a good idea. Thanks for the feedback! I will investigate.

@jamespack
Copy link
Contributor Author

image

@PankajBhojwani is this what you had in mind?

I pushed to the branch. It still supports select with the cursor and ctrl+c/ctrl+v. But now on right click we simply show the custom MenuFlyout. Awesome suggestion!!

Comment on lines 423 to 425
textBlock.CopySelectionToClipboard();
}
_queryBox().CopySelectionToClipboard();
Copy link
Member

@lhecker lhecker Jun 23, 2025

Choose a reason for hiding this comment

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

Questions:

  • This copies to the clipboard twice in a row. Is that intentional?
  • Do we need to handle Ctrl+C manually here? Why is it not handled as part of the _richBlock context menu?
  • Most importantly, why don't we use our custom TextMenuFlyout class here, similar to other parts of the code base? It should support RichTextBlock.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. No, Its not intentional. :|
  2. I think it's useful. I'm sure other people would find it useful too. There was other code here that did something similar. "Get in where you fit in?".
  3. Dang, it! My gut told me something was in the project for that. Didnt look hard enough. Ill swap it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So ill basically be at the previous commit only using the TextMenuFlyout class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update pushed. Thanks for your feedback!

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.

3 participants