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

Add copyFormatting keybinding arg and array support #6004

Merged
merged 27 commits into from
Aug 15, 2020

Conversation

carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented May 19, 2020

Summary of the Pull Request

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.

References

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

PR Checklist

Detailed Description of the Pull Request / Additional comments

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.

Validation Steps Performed

Validated behavior with every combination of values below:

  • copyFormatting global: { true, false, [], ["html"] }
  • copyFormatting copy arg: { null, true, false, [], [, "html"]}

@carlos-zamora carlos-zamora added Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. labels May 19, 2020
@ghost ghost added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Issue-Task It's a feature request, but it doesn't really need a major design. labels May 19, 2020
src/cascadia/TerminalApp/ActionArgs.h Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/ActionArgs.idl Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalControl/TermControl.idl Outdated Show resolved Hide resolved
@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jun 10, 2020
@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Jun 17, 2020
@ghost
Copy link

ghost commented Jun 17, 2020

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@ghost ghost closed this Jun 24, 2020
@zadjii-msft
Copy link
Member

shh bot, chill

@zadjii-msft zadjii-msft reopened this Jun 24, 2020
@ghost ghost removed the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Jun 24, 2020
@carlos-zamora
Copy link
Member Author

Urgh. Thanks. I'll get to this one today.

@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jun 24, 2020
@carlos-zamora carlos-zamora force-pushed the dev/cazamor/copy-formatting-arg branch from 48c7b0d to f2bfeda Compare June 24, 2020 20:44
@carlos-zamora
Copy link
Member Author

@DHowett Latest commit tries to use the new Json Utils but I had some trouble. No longer builds. Could I get some help?

@zadjii-msft zadjii-msft removed the Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) label Jul 7, 2020
@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 7, 2020
@DHowett DHowett removed their assignment Aug 7, 2020
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 10, 2020
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

only nits remaining are on the string formatting! well done

doc/cascadia/SettingsSchema.md Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Resources/en-US/Resources.resw Outdated Show resolved Hide resolved
@DHowett DHowett removed their assignment Aug 12, 2020
@carlos-zamora
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@carlos-zamora
Copy link
Member Author

preview

@DHowett DHowett merged commit 24b8c13 into master Aug 15, 2020
@DHowett DHowett deleted the dev/cazamor/copy-formatting-arg branch August 15, 2020 01:02
@ghost
Copy link

ghost commented Aug 26, 2020

🎉Windows Terminal Preview v1.3.2382.0 has been released which incorporates this pull request.:tada:

Handy links:

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 Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
3 participants