source: trunk/tools/neercs/term/pty.h @ 2139

Last change on this file since 2139 was 2005, checked in by sam, 8 years ago

neercs: ESC no longer quits; but closing the shell does.

File size: 572 bytes
Line 
1//
2// Neercs
3//
4
5#if !defined __TERM_PTY_H__
6#define __TERM_PTY_H__
7
8class Pty
9{
10public:
11    Pty();
12    ~Pty();
13
14    void Run(char const *command, ivec2 size);
15    bool IsEof() const;
16
17    size_t ReadData(char *data, size_t maxlen);
18    void UnreadData(char *data, size_t len);
19    size_t WriteData(char const *data, size_t len);
20
21    void SetWindowSize(ivec2 size, int64_t fd = -1);
22
23private:
24    int64_t m_fd;
25    int64_t m_pid;
26    bool m_eof;
27    char const *m_argv[2];
28    char *m_unread_data;
29    size_t m_unread_len;
30    ivec2 m_size;
31};
32
33#endif // __TERM_PTY_H__
34
Note: See TracBrowser for help on using the repository browser.