mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 18:43:54 -06:00
Stop leaking CPR sequences
This commit is contained in:
parent
c7c742c326
commit
0559c94294
@ -391,19 +391,18 @@ bool InputStateMachineEngine::ActionCsiDispatch(const VTID id, const VTParameter
|
|||||||
//
|
//
|
||||||
// Focus events in conpty are special, so don't flush those through either.
|
// Focus events in conpty are special, so don't flush those through either.
|
||||||
// See GH#12799, GH#12900 for details
|
// See GH#12799, GH#12900 for details
|
||||||
if (_pDispatch->IsVtInputEnabled() &&
|
const auto vtInputEnabled = _pDispatch->IsVtInputEnabled();
|
||||||
id != CsiActionCodes::Win32KeyboardInput &&
|
|
||||||
id != CsiActionCodes::FocusIn &&
|
|
||||||
id != CsiActionCodes::FocusOut)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case CsiActionCodes::MouseDown:
|
case CsiActionCodes::MouseDown:
|
||||||
case CsiActionCodes::MouseUp:
|
case CsiActionCodes::MouseUp:
|
||||||
{
|
{
|
||||||
|
if (vtInputEnabled)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
DWORD buttonState = 0;
|
DWORD buttonState = 0;
|
||||||
DWORD eventFlags = 0;
|
DWORD eventFlags = 0;
|
||||||
const auto firstParameter = parameters.at(0).value_or(0);
|
const auto firstParameter = parameters.at(0).value_or(0);
|
||||||
@ -432,6 +431,10 @@ bool InputStateMachineEngine::ActionCsiDispatch(const VTID id, const VTParameter
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (vtInputEnabled)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
[[fallthrough]];
|
[[fallthrough]];
|
||||||
case CsiActionCodes::ArrowUp:
|
case CsiActionCodes::ArrowUp:
|
||||||
case CsiActionCodes::ArrowDown:
|
case CsiActionCodes::ArrowDown:
|
||||||
@ -443,6 +446,10 @@ bool InputStateMachineEngine::ActionCsiDispatch(const VTID id, const VTParameter
|
|||||||
case CsiActionCodes::CSI_F2:
|
case CsiActionCodes::CSI_F2:
|
||||||
case CsiActionCodes::CSI_F4:
|
case CsiActionCodes::CSI_F4:
|
||||||
{
|
{
|
||||||
|
if (vtInputEnabled)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
short vkey = 0;
|
short vkey = 0;
|
||||||
if (_GetCursorKeysVkey(id, vkey))
|
if (_GetCursorKeysVkey(id, vkey))
|
||||||
{
|
{
|
||||||
@ -453,6 +460,10 @@ bool InputStateMachineEngine::ActionCsiDispatch(const VTID id, const VTParameter
|
|||||||
}
|
}
|
||||||
case CsiActionCodes::Generic:
|
case CsiActionCodes::Generic:
|
||||||
{
|
{
|
||||||
|
if (vtInputEnabled)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
short vkey = 0;
|
short vkey = 0;
|
||||||
if (_GetGenericVkey(parameters.at(0), vkey))
|
if (_GetGenericVkey(parameters.at(0), vkey))
|
||||||
{
|
{
|
||||||
@ -462,6 +473,10 @@ bool InputStateMachineEngine::ActionCsiDispatch(const VTID id, const VTParameter
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case CsiActionCodes::CursorBackTab:
|
case CsiActionCodes::CursorBackTab:
|
||||||
|
if (vtInputEnabled)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
_WriteSingleKey(VK_TAB, SHIFT_PRESSED);
|
_WriteSingleKey(VK_TAB, SHIFT_PRESSED);
|
||||||
return true;
|
return true;
|
||||||
case CsiActionCodes::FocusIn:
|
case CsiActionCodes::FocusIn:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user