contour-terminal / contour

Modern C++ Terminal Emulator
http://contour-terminal.org/
Apache License 2.0
2.4k stars 103 forks source link

formatted copy to clipboard #85

Open christianparpart opened 5 years ago

christianparpart commented 5 years ago

Should support:

Action Name Description
CopyToClipboardHTML Copies selection to clipboard in HTML format.
CopyToClipboardVT Copies selection to clipboard in VT escape sequences.
CopyToClipboard Copies selection to clipboard, but only the text (already present)
CopyToClipboardPNG Copies selection to clipboard in PNG image file format.
theoniko commented 1 year ago

Could i give it a try? Are there any similar already implemented actions to check as walkthrough?

christianparpart commented 1 year ago

Oh absolutely, and many thanks for your interest. Would you mind joining Discord for that for a more interactive guided walkthrough?

christianparpart commented 1 year ago

@theoniko to wich of the 3 yet missing ones are you interested in the most? I think the easiest one that might have an impact on users that want it would be the HTML version. for the image (PNG) version I think some prep-work would be needed to have that trivially implemented. I could do the prep-work first such that you'd have it easier to implement CopyToClipboardPNG after that. So starting with CopyToClipboardHTML might probably be most rewarding as a starter.

Our Discord (if you haven't found it already) is here: https://discord.gg/xQCRUCtc

theoniko commented 1 year ago

Ok, i will try to implement the CopyToClipboardHTML then. Let's talk there for the details.

theoniko commented 1 year ago

I created a draft pr https://github.com/contour-terminal/contour/pull/942 as a starting point. Basically, i added an extra variable on yml file and based on the string value selected (internally converted to enum class values) i call the correspoding qt function. In case of HTML i use https://doc.qt.io/qt-5/qstring.html#toHtmlEscaped for example. I am pretty sure that this is not the correct qt function to make it HTML. Could you give an example how the resulted text should look like? Am i the right direction or you wanted something to be done in a different way?