5#ifndef WPINET_UV_TTY_H_
6#define WPINET_UV_TTY_H_
25 struct private_init {};
28 explicit Tty(
const private_init&) {}
29 ~Tty() noexcept override = default;
51 return Create(*loop, fd, readable);
77 int width = 0, height = 0;
79 return std::pair{width, height};
void ReportError(int err) const
Report an error.
Definition Handle.h:252
bool Invoke(F &&f, Args &&... args) const
Definition Handle.h:267
Event loop.
Definition Loop.h:37
uv_tty_t * GetRaw() const noexcept
Definition Stream.h:326
TTY handle.
Definition Tty.h:24
~Tty() noexcept override=default
static std::shared_ptr< Tty > Create(Loop &loop, uv_file fd, bool readable)
Create a TTY handle.
Tty(const private_init &)
Definition Tty.h:28
void SetMode(uv_tty_mode_t mode)
Set the TTY using the specified terminal mode.
Definition Tty.h:59
void ResetMode()
Reset TTY settings to default values for the next process to take over.
Definition Tty.h:70
std::pair< int, int > GetWindowSize()
Gets the current window size.
Definition Tty.h:76
Implement std::hash so that hash_code can be used in STL containers.
Definition PointerIntPair.h:280
uv_tty_mode_t
Definition uv.h:795
UV_EXTERN int uv_tty_set_mode(uv_tty_t *, uv_tty_mode_t mode)
UV_EXTERN int uv_tty_reset_mode(void)
UV_EXTERN int uv_tty_get_winsize(uv_tty_t *, int *width, int *height)
int uv_file
Definition win.h:243