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

Feature Request: Add a setting that disables HTML copy #2690

Closed
allykzam opened this issue Sep 6, 2019 · 7 comments
Closed

Feature Request: Add a setting that disables HTML copy #2690

allykzam opened this issue Sep 6, 2019 · 7 comments
Assignees
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal.

Comments

@allykzam
Copy link

allykzam commented Sep 6, 2019

Description of the new feature/enhancement

The new HTML copy feature introduced in v0.4.2382.0 may not always be desirable, and removing the formatting typically means either opening a text editor like Notepad, pasting the text, and then copying it again, or asking the receiving application to strip formatting. When text is copied out of the terminal on a regular basis, this small delays can add up a bit, and suck up time in someone's day. For cases where a user knows this is going to happen to them frequently, it would be helpful if there were a setting that could disable the HTML copy feature.

If entirely disabling HTML copy is undesirable, under the assumption that users may still want to keep formatting sometimes, another possible option would be to provide separate key bindings that behave the "old" way. However, admittedly with no experience with the codebase, this seems like it would be more work.

@allykzam allykzam added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Sep 6, 2019
@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 Sep 6, 2019
@zadjii-msft zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Sep 6, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Sep 6, 2019
@DHowett-MSFT
Copy link
Contributor

As an aside, what application is serving as the destination that doesn't support "Paste [as] Plain Text"?

@allykzam
Copy link
Author

allykzam commented Sep 6, 2019

The last place I pasted before leaving work today was the web version of outlook, which actually does have the option to paste as plain text - but it's in a context menu that has to be clicked and has no keyboard shortcut. I have a tendency to copy something out of the terminal, start typing an email, and then press Ctrl+V, only to find that I've pasted colored text with a dark background into my email.

Like I said in the original post, it's a small delay; it's just a new delay that wasn't there before the last update, in exchange for a feature I wasn't really looking for and typically don't want to use.

@bitcrazed bitcrazed self-assigned this Sep 9, 2019
@bitcrazed
Copy link
Contributor

bitcrazed commented Sep 9, 2019

@amazingant

When copying text to the clipboard, Terminal copies both the plaintext, and HTML text.

Applications that can handle pasting rich-text generally allow you to paste content "keeping source formatting", "keeping target formatting", or "pasting plain text".

These options are usually available via the context menu (Mouse: right-click. Keyboard: right-context-menu-key / SHIFT+F10) and is a well understood, and well supported behavior by most rich-text apps/tools.

@allykzam
Copy link
Author

@bitcrazed Thanks, but as I mentioned above, the place I'm mostly running into this does support these options via a context menu after I paste. In the web version of outlook, right clicking and using the keyboard shortcuts mentioned just bring up my browser's context menu, which only includes "paste".

@bitcrazed
Copy link
Contributor

bitcrazed commented Sep 10, 2019

@amazingant After copying Terminal contents to the clipboard, when I hit the context-menu key / SHIFT+F10 in Outlook online, I see a context menu that offers me both paste and paste as text:

image

This MAY be because I am running a preview release of Outlook online, and if so, its likely this will be publicly released before long.

@allykzam
Copy link
Author

Nope; that's Chrome's default context menu, I use Firefox. :)

@bitcrazed
Copy link
Contributor

Then this would be a great bug to file on the Firefox team. It is 2019 and the Clipboard's ability to contain content in multiple formats has been there for at least 20 years.

DHowett pushed a commit that referenced this issue Aug 15, 2020
Adds array support for the existing `copyFormatting` global setting.
This allows users to define which formats they would specifically like
to be copied.

A boolean value is still accepted and is translated to the following:
- `false` --> `"none"` or `[]`
- `true` --> `"all"` or `["html", "rtf"]`

This also adds `copyFormatting` as a keybinding arg for `copy`. As with
the global setting, a boolean value and array value is accepted.

CopyFormat is a WinRT enum where each accepted format is a flag.
Currently accepted formats include `html`, and `rtf`. A boolean value is
accepted and converted. `true` is a conjunction of all the formats.
`false` only includes plain text.

For the global setting, `null` is not accepted. We already have a
default value from before so no worries there.

For the keybinding arg, `null` (the default value) means that we just do
what the global arg says to do. Overall, the `copyFormatting` keybinding
arg is an override of the global setting **when using that keybinding**.

References #5212 - Spec for formatted copying
References #2690 - disable html copy

Validated behavior with every combination of values below:
- `copyFormatting` global: { `true`, `false`, `[]`, `["html"]` }
- `copyFormatting` copy arg:
  { `null`, `true`, `false`, `[]`, `[, "html"]`}

Closes #4191
Closes #5262
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

4 participants