-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
doc: add a spec for the change to formatted copying #5212
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e90193c
spec for html copy
cinnamon-msft b691666
Update doc/specs/#4191 - Formatted Copy/spec.md
cinnamon-msft fa1e65b
addressed feedback
cinnamon-msft 061bd6a
Merge branch 'cinnamon/html-copy-spec' of https://github.com/microsof…
cinnamon-msft 43a0522
Update doc/specs/#4191 - Formatted Copy/spec.md
cinnamon-msft fce8895
Update doc/specs/#4191 - Formatted Copy/spec.md
cinnamon-msft 7f62273
Update doc/specs/#4191 - Formatted Copy/spec.md
cinnamon-msft ff82a35
Merge branch 'master' into cinnamon/html-copy-spec
cinnamon-msft fb5ddc2
minor fixes
cinnamon-msft 16f23a2
added conclusion
cinnamon-msft a9e0147
Update doc/specs/#4191 - Formatted Copy/spec.md
cinnamon-msft ac55620
removed alt functionality on mouse
cinnamon-msft 9c39283
Merge branch 'cinnamon/html-copy-spec' of https://github.com/microsof…
cinnamon-msft 4953f54
addressed nits
cinnamon-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
--- | ||
author: Kayla Cinnamon @cinnamon-msft | ||
created on: 2020-04-01 | ||
last updated: 2020-04-07 | ||
issue id: #4191 | ||
--- | ||
|
||
# Formatted Copy | ||
|
||
## Abstract | ||
|
||
When copying text, the Terminal should provide the option of including formatting. Not all apps that receive text allow for picking which format you want when pasting. The default should be to only copy plain text, based on the response from this poll on Twitter. | ||
|
||
![Twitter poll](twitter-poll.png) | ||
|
||
## Solution Proposals | ||
|
||
A proposal for the right click behavior as well as two user settings proposals are described below. The conclusion the team arrived at is at the bottom under the [Conclusions section](#conclusions). | ||
|
||
1. [Settings option 1 - global setting](#settings-option-1---global-setting) | ||
2. [Settings option 2 - key binding argument](#settings-option-2---key-binding-argument) | ||
3. [Right click behavior](#right-click-behavior) | ||
|
||
### Settings option 1 - global setting | ||
|
||
We could have a global setting that when enabled, would copy formatting to the clipboard on all copy operations. | ||
|
||
### Settings option 2 - key binding argument | ||
|
||
We could add an argument to the `copy` key binding argument to allow for formatted copying when the user chooses to do so. | ||
|
||
### Right click behavior | ||
|
||
By default, right clicking to copy would only copy the plain text. | ||
|
||
## UI/UX Design | ||
|
||
### Settings option 1 - global setting | ||
|
||
a. The user could list which kinds of formats they want included when they copy. When right clicking, they would copy with these formats. | ||
|
||
`"copyFormats": ["html","rtf","plain"]` | ||
|
||
b. We could also just combine html and rtf into a single boolean. Users would either get plain text only (`false`) or all formatting (`true`) onto their clipboard. If this is set to `true`, the default right click behavior is reversed: right clicking copies the formatting. | ||
|
||
`"copyFormatting": true` | ||
|
||
### Settings option 2 - key binding argument | ||
|
||
a. Just like the `trimWhitespace` argument you can add to the `copy` key binding, we could add one for text formatting. This would not change the right click behavior. | ||
|
||
`{"command": {"action": "copy", "keepFormatting": true}, "keys": "ctrl+a"}` | ||
|
||
b. We could also split out the html and rtf formats. The right click behavior would still stay as default. | ||
|
||
`{"command": {"action": "copy", "formats": ["html","rtf","plain"]}, "keys": "ctrl+a"}` | ||
|
||
## Capabilities | ||
|
||
### Accessibility | ||
|
||
This shouldn't affect accessibility. | ||
|
||
### Security | ||
|
||
This does not affect security. | ||
|
||
### Reliability | ||
|
||
This does not affect reliability. | ||
|
||
### Compatibility | ||
|
||
This breaks the existing behavior of always copying the formatting. The justification for breaking this default behavior is in response to the community saying the default should be plain text only. | ||
|
||
### Performance, Power, and Efficiency | ||
|
||
## Potential Issues | ||
|
||
One possible issue is that discovering how to copy the formatting might be difficult to find. We could mitigate this by adding it into the settings.json file and commenting it out. | ||
|
||
## Conclusions | ||
|
||
The team has decided to have plain text as the default copy behavior and to enable formatted copying with a global setting that accepts a boolean value (settings option 1 - global setting, option b). In the future, we can modify this setting to also accept an array, so the user can specify which formats they would like to copy. Additionally, a key binding can be added to allow for greater flexibility. | ||
|
||
## Future considerations | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #1553 - We should just treat |
||
|
||
We could always add an additional option if people want more flexibility. For example, if we ship a global setting now, we could ship a key binding later that lets you choose how you want to copy, and vice versa. Additionally, we can add functionality to the global setting that allows for specific formats or styles to be copied. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait didn't we decide on a combo of both 2 & 3?
We do the global setting now, as a boolean, because that's easy. (This is 2a)
We can then update that to additionally accept an array in the future, where
true
==[html, rtf, plain]
andfalse
==[plain]
(This is 2b)Then, we could further add an optional parameter to the copy
ShortcutAction
. If it's set, we'll copy with the provided formatting. Otherwise, we'll use the value of the global setting? (This is 3)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I guess this is kinda what it does say, I just didn't immediately parse that this was a phased implementation plan