forked from terminalpp/terminalpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bypass_pty.h
46 lines (30 loc) · 945 Bytes
/
bypass_pty.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#if (defined ARCH_WINDOWS)
#include <mutex>
#include <condition_variable>
#include <atomic>
#include <thread>
#include "windows.h"
#include "pty.h"
namespace tpp {
class BypassPTYMaster : public PTYMaster {
public:
explicit BypassPTYMaster(Command const & command);
~BypassPTYMaster() override;
void terminate() override;
void send(char const * buffer, size_t numBytes) override;
size_t receive(char * buffer, size_t bufferSize) override;
void resize(int cols, int rows) override;
private:
void start();
Command command_;
std::thread waiter_;
/* The pipe from which input should be read. */
HANDLE pipeIn_;
/* Pipe to which data for the application should be sent. */
HANDLE pipeOut_;
/* Information about the process being executed. */
PROCESS_INFORMATION pInfo_;
}; // tpp::BypassPTYMaster
} // namespace ui
#endif