That Terminal
A terminal emulator designed for video making purposes.
forkpty.hh
Go to the documentation of this file.
1 #ifndef bqtForkPTYHH
2 #define bqtForkPTYHH
7 #include <string>
8 #include <csignal>
9 
15 class ForkPTY
16 {
17 public:
19  ForkPTY(std::size_t width, std::size_t height) { Open(width,height); }
20 
22  ~ForkPTY();
23 
27  void Open(std::size_t width, std::size_t height);
28 
30  void Close();
31 
33  bool Active() const;
34 
36  int getfd() const;
37 
43  int Send(std::string_view buffer);
44 
50  std::pair<std::string,int> Recv();
51 
53  void Kill(int signal);
54 
58  void Resize(unsigned xsize, unsigned ysize);
59 
60 private:
61  int fd = -1, pid = -1;
62 };
63 
64 #endif
Definition: forkpty.hh:16
std::pair< std::string, int > Recv()
Definition: forkpty.cc:100
void Open(std::size_t width, std::size_t height)
Definition: forkpty.cc:46
int Send(std::string_view buffer)
Definition: forkpty.cc:95
ForkPTY(std::size_t width, std::size_t height)
Definition: forkpty.hh:19
int getfd() const
Definition: forkpty.cc:33
void Resize(unsigned xsize, unsigned ysize)
Definition: forkpty.cc:116
void Kill(int signal)
Definition: forkpty.cc:111
void Close()
Definition: forkpty.cc:87
~ForkPTY()
Definition: forkpty.cc:38
bool Active() const
Definition: forkpty.cc:28