Skip to content
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

Connect GenRTF to conhost (Win32Interactivity Clipboard) #3560

Closed
DHowett-MSFT opened this issue Nov 13, 2019 · 4 comments · Fixed by #3595
Closed

Connect GenRTF to conhost (Win32Interactivity Clipboard) #3560

DHowett-MSFT opened this issue Nov 13, 2019 · 4 comments · Fixed by #3595
Assignees
Labels
Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@DHowett-MSFT
Copy link
Contributor

Make conhost do RTF!

@DHowett-MSFT @carlos-zamora What needs to be done to bring this into conhost? Are you gonna create a new issue?

Originally posted by @anirudhrb in #3535 (comment)

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 13, 2019
@DHowett-MSFT DHowett-MSFT added Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase labels Nov 13, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Nov 13, 2019
@DHowett-MSFT DHowett-MSFT added Needs-Tag-Fix Doesn't match tag requirements and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 13, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Nov 13, 2019
@DHowett-MSFT DHowett-MSFT added this to the 21H1 milestone Nov 13, 2019
@anirudhrb
Copy link
Contributor

I would like to pick this up too!

I believe this is the file I should be looking at: https://github.com/microsoft/terminal/blob/master/src/interactivity/win32/Clipboard.cpp

At a high-level, I should do the same things that are being done for HTML copy right?

Also, we are registering a format for HTML here:

UINT const CF_HTML = RegisterClipboardFormatW(L"HTML Format");

The way I understand it, any other program that wants to read this HTML needs to know that format name is HTML Format. Similarly, is there some standard name for RTF? Is it simply RTF Format? Do we document these names somewhere?

Let me know if I'm on the right track here.

@DHowett-MSFT
Copy link
Contributor Author

You’re on the right track! I’ll assign this to you.

I’m not sure what the legacy clipboard API contract is for RTF content, but figuring that out is half the fun!

@DHowett-MSFT
Copy link
Contributor Author

To trigger formatted copy in conhost, you’ll want to hold down Alt when you issue the final right-click that performs the copy. It’s not “on by default” like Terminal’s is.

@ghost ghost added the In-PR This issue has a related PR label Nov 15, 2019
@anirudhrb
Copy link
Contributor

@DHowett-MSFT raised a PR (#3595) for this. Please review.

@ghost ghost closed this as completed in #3595 Dec 5, 2019
ghost pushed a commit that referenced this issue Dec 5, 2019
RTF data is now copied to the clipboard. The clipboard format name
used for RTF data is `Rich Text Format`.

Refactored some code in `Clipboard.cpp` so that the code for setting
data to the clipboard is re-used. Also, renamed parameter
`fAlsoCopyHtml` to `fAlsoCopyFormatting` to make it more generic.

Tested by copying text from console to WordPad. Also verified that
HTML copy is not regressed by copying to Word.

Closes #3560.
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Dec 5, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants