mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 19:25:11 -07:00
Added os_isatty
This commit is contained in:
parent
b8364da582
commit
096eadbcbb
@ -124,6 +124,11 @@ void os_breakcheck()
|
||||
fill_input_buf(false);
|
||||
}
|
||||
|
||||
bool os_isatty(int fd)
|
||||
{
|
||||
return uv_guess_handle(fd) == UV_TTY;
|
||||
}
|
||||
|
||||
// This is a replacement for the old `WaitForChar` function in os_unix.c
|
||||
static InbufPollResult inbuf_poll(int32_t ms)
|
||||
{
|
||||
|
@ -13,5 +13,11 @@ int os_inchar(uint8_t *, int, int32_t, int);
|
||||
bool os_char_avail(void);
|
||||
void os_breakcheck(void);
|
||||
|
||||
/// Test whether a file descriptor refers to a terminal.
|
||||
///
|
||||
/// @param fd File descriptor.
|
||||
/// @return `true` if file descriptor refers to a terminal.
|
||||
bool os_isatty(int fd);
|
||||
|
||||
#endif // NEOVIM_OS_INPUT_H
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user