7395: do not clear text selection upon PrintScreen (#7883)

When handling SendKey, preserve selection upon PrintScreen (VK_SNAPSHOT)

Closes #7395
This commit is contained in:
Don-Vito 2020-10-16 03:01:01 +03:00 committed by GitHub
parent bd7cd5512d
commit 60d681d564
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -953,8 +953,9 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation
// flow through to the terminal.
// GH#6423 - don't dismiss selection if the key that was pressed was a
// modifier key. We'll wait for a real keystroke to dismiss the
// GH #7395 - don't dismiss selection when taking PrintScreen
// selection.
if (_terminal->IsSelectionActive() && !KeyEvent::IsModifierKey(vkey))
if (_terminal->IsSelectionActive() && !KeyEvent::IsModifierKey(vkey) && vkey != VK_SNAPSHOT)
{
_terminal->ClearSelection();
_renderer->TriggerSelection();