Avoid encoding plain text with win32-input-mode

This commit is contained in:
Leonard Hecker 2024-08-03 02:31:53 +02:00
parent 8149bd0dd0
commit 1d25de170e
2 changed files with 2 additions and 26 deletions

View File

@ -65,18 +65,8 @@ bool InteractDispatch::WriteCtrlKey(const INPUT_RECORD& event)
// - True.
bool InteractDispatch::WriteString(const std::wstring_view string)
{
if (!string.empty())
{
const auto codepage = _api.GetConsoleOutputCP();
InputEventQueue keyEvents;
for (const auto& wch : string)
{
CharToKeyEvents(wch, codepage, keyEvents);
}
WriteInput(keyEvents);
}
const auto& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
gci.GetActiveInputBuffer()->WriteString(string);
return true;
}

View File

@ -287,20 +287,6 @@ bool InputStateMachineEngine::ActionPrintString(const std::wstring_view string)
// - true iff we successfully dispatched the sequence.
bool InputStateMachineEngine::ActionPassThroughString(const std::wstring_view string, const bool /*flush*/)
{
if (_pDispatch->IsVtInputEnabled())
{
// Synthesize string into key events that we'll write to the buffer
// similar to TerminalInput::_SendInputSequence
if (!string.empty())
{
InputEventQueue inputEvents;
for (const auto& wch : string)
{
inputEvents.push_back(SynthesizeKeyEvent(true, 1, 0, 0, wch, 0));
}
return _pDispatch->WriteInput(inputEvents);
}
}
return ActionPrintString(string);
}