mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-13 13:10:16 -06:00
Stop leaking CPR sequences (#19620)
Due to the `IsVtInputEnabled` early return, we'd skip the `_captureNextCursorPositionReport` by accident. Closes #19575 Closes #19609
This commit is contained in:
parent
7a7cdec91f
commit
224ac9de47
@ -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