2019-05-03 00:29:04 +02:00
|
|
|
/*++
|
|
|
|
Copyright (c) Microsoft Corporation
|
|
|
|
Licensed under the MIT license.
|
|
|
|
|
|
|
|
Module Name:
|
|
|
|
- VtInputThread.hpp
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
- Defines methods that wrap the thread that reads VT input from a pipe and
|
|
|
|
feeds it into the console's input buffer.
|
|
|
|
|
|
|
|
Author(s):
|
|
|
|
- Mike Griese (migrie) 15 Aug 2017
|
|
|
|
--*/
|
|
|
|
#pragma once
|
|
|
|
|
2020-11-25 22:02:10 +01:00
|
|
|
#include "../terminal/parser/StateMachine.hpp"
|
2019-05-03 00:29:04 +02:00
|
|
|
|
|
|
|
namespace Microsoft::Console
|
|
|
|
{
|
|
|
|
class VtInputThread
|
|
|
|
{
|
|
|
|
public:
|
2019-11-08 22:44:52 +01:00
|
|
|
VtInputThread(_In_ wil::unique_hfile hPipe, const bool inheritCursor);
|
2019-05-03 00:29:04 +02:00
|
|
|
|
2019-06-11 22:27:09 +02:00
|
|
|
[[nodiscard]] HRESULT Start();
|
2019-05-17 22:32:51 +02:00
|
|
|
static DWORD WINAPI StaticVtInputThreadProc(_In_ LPVOID lpParameter);
|
2019-11-08 22:44:52 +01:00
|
|
|
void DoReadInput(const bool throwOnFail);
|
2019-05-03 00:29:04 +02:00
|
|
|
|
|
|
|
private:
|
2020-02-04 03:06:55 +01:00
|
|
|
[[nodiscard]] HRESULT _HandleRunInput(const std::string_view u8Str);
|
2019-05-03 00:29:04 +02:00
|
|
|
DWORD _InputThread();
|
|
|
|
|
|
|
|
wil::unique_hfile _hFile;
|
|
|
|
wil::unique_handle _hThread;
|
|
|
|
DWORD _dwThreadId;
|
|
|
|
|
2019-11-08 22:44:52 +01:00
|
|
|
bool _exitRequested;
|
|
|
|
HRESULT _exitResult;
|
|
|
|
|
2019-05-30 20:14:21 +02:00
|
|
|
std::unique_ptr<Microsoft::Console::VirtualTerminal::StateMachine> _pInputStateMachine;
|
2020-02-04 03:06:55 +01:00
|
|
|
til::u8state _u8State;
|
2019-05-03 00:29:04 +02:00
|
|
|
};
|
|
|
|
}
|