-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 settings to warn about large or multiline pastes #6631
Changes from 8 commits
618a4c4
0e515f5
2c5e78c
6385175
5d73dc7
6006394
21eb079
b8152fc
aaca27c
0861584
0f083cf
33196af
b7dfde2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ IBind | |
IClass | ||
IComparable | ||
ICustom | ||
IDialog | ||
IDirect | ||
IExplorer | ||
IMap | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,8 @@ class TerminalApp::GlobalAppSettings final | |
GETSET_PROPERTY(std::wstring, WordDelimiters); // default value set in constructor | ||
GETSET_PROPERTY(bool, CopyOnSelect, false); | ||
GETSET_PROPERTY(bool, CopyFormatting, false); | ||
GETSET_PROPERTY(bool, WarnAboutLargePaste, true); | ||
GETSET_PROPERTY(bool, WarnAboutMultiLinePaste, true); | ||
Comment on lines
+78
to
+79
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. Should these be enabled by default? 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. Yep 😊 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. I think I was initially reluctant to enabled by default for both, but I've sat on it for a bit and I concur, enabled by default seems sensible. |
||
GETSET_PROPERTY(LaunchPosition, InitialPosition); | ||
GETSET_PROPERTY(winrt::TerminalApp::LaunchMode, LaunchMode, winrt::TerminalApp::LaunchMode::DefaultMode); | ||
GETSET_PROPERTY(bool, SnapToGridOnResize, true); | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -347,4 +347,28 @@ | |||||
<value>Command Prompt</value> | ||||||
<comment>This is the name of "Command Prompt", as localized in Windows. The localization here should match the one in the Windows product for "Command Prompt"</comment> | ||||||
</data> | ||||||
<data name="LargePasteDialog.CloseButtonText" xml:space="preserve"> | ||||||
<value>Cancel</value> | ||||||
</data> | ||||||
<data name="LargePasteDialog.Content" xml:space="preserve"> | ||||||
<value>You are about to paste text that is longer than 5 KiB. This can make the terminal unresponsive while the text is being received on the other end. Are you sure you want to continue?</value> | ||||||
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. nit:
Suggested change
@cinnamon-msft for confirmation on the wording here though. 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. @zadjii-msft's wording looks great 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. Okay actually, can we change "Are you sure you want to continue?" to "Do you wish to continue?" to match the other message? |
||||||
</data> | ||||||
<data name="LargePasteDialog.PrimaryButtonText" xml:space="preserve"> | ||||||
<value>Paste anyway</value> | ||||||
</data> | ||||||
<data name="LargePasteDialog.Title" xml:space="preserve"> | ||||||
<value>Warning</value> | ||||||
</data> | ||||||
<data name="MultiLinePasteDialog.CloseButtonText" xml:space="preserve"> | ||||||
<value>Cancel</value> | ||||||
</data> | ||||||
<data name="MultiLinePasteDialog.Content" xml:space="preserve"> | ||||||
<value>You are about to paste text that contains the "new line" character. If you paste text that contains the "new line" character into a shell, one or more command(s) will be executed automatically upon paste. Are you sure you want to continue?</value> | ||||||
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. nit:
Suggested change
again, @cinnamon-msft to ACK this wording 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. I might rephrase as "You are about to paste text that contains multiple lines. If you paste this text into your shell, it may result in the unexpected execution of commands. Are you sure you want to continue?" edit: "are you sure you wish to continue?" ("wish" stuck with me a bit more than "want") 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. That's my go at wordsmithing 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. I think I like: You are about to paste text that contains multiple lines. If you paste this text into your shell, it may result in the unexpected execution of commands. Do you wish to continue? |
||||||
</data> | ||||||
<data name="MultiLinePasteDialog.PrimaryButtonText" xml:space="preserve"> | ||||||
<value>Paste anyway</value> | ||||||
</data> | ||||||
<data name="MultiLinePasteDialog.Title" xml:space="preserve"> | ||||||
<value>Warning</value> | ||||||
</data> | ||||||
</root> |
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.
For Discussion:
I'm wondering if we'll be adding more "warning" features over time. If so, what's everybody's thoughts on having a "warning." prefix? So these settings would be called
warning.largePaste
andwarning.multiLinePaste
.And we could override some others like
confirmCloseAllTabs
to bewarning.closeWithMultipleTabs
.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.
oh wow, I actually like that a lot. I'd love another ACK on that design, but I'm on board.
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.
I'll ACK that design. Should we do it in post so we can let greg904 in peace to merge his PR?
Making it a separate PR allows us to also add a compatibility lookup for
warning.closeAllTabs
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.
I third this :)