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

Prevent read-only warning on mouse move, wheel and release #9107

Merged
1 commit merged into from
Feb 11, 2021

Conversation

Don-Vito
Copy link
Contributor

@Don-Vito Don-Vito commented Feb 10, 2021

Avoid sending mouse move / wheel / release to Terminal in the first place.
This kind of short-circuiting will prevent us reaching the
attempt to send input to connection
(that could result in the warning dialog in the read-only mode)

Closes #9074

@ghost ghost added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Severity-Blocking We won't ship a release like this! No-siree. labels Feb 10, 2021
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.

This seems great to me. Thank you!

@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Feb 11, 2021
@ghost
Copy link

ghost commented Feb 11, 2021

Hello @DHowett!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 3 hours 57 minutes. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@Don-Vito
Copy link
Contributor Author

@zadjii-msft - can you please take a look?

@@ -970,6 +971,7 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
const auto vkey = gsl::narrow_cast<WORD>(e.OriginalKey());
const auto scanCode = gsl::narrow_cast<WORD>(e.KeyStatus().ScanCode);

// Short-circuit isReadOnly check to avoid warning dialog
if (_isReadOnly)
{
e.Handled(!keyDown || _TryHandleKeyBinding(vkey, scanCode, modifiers));
Copy link
Member

Choose a reason for hiding this comment

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

Hey I know this isn't a part of this PR, but should this block be below the enhanced key and alt+# branches? Like move it to ~line 997? It seems like those two branches might affect the behavior of the keybinding handling

@ghost ghost merged commit 16d00a6 into microsoft:main Feb 11, 2021
@ghost
Copy link

ghost commented Mar 1, 2021

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

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Severity-Blocking We won't ship a release like this! No-siree.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VT mouse mode causes clicks to display read-only pane popup
3 participants