diff options
author | erw7 <erw7.github@gmail.com> | 2019-04-28 18:46:48 +0900 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-04-28 11:46:48 +0200 |
commit | 8072f085d2edc254334af52261c6ff68d9143834 (patch) | |
tree | c40d4363047951fc97215a0e5ead755ce1a4edfd /src/nvim/event/stream.c | |
parent | cf80fd9e02422f90ecb967aacf7a5549246b4689 (diff) | |
download | rneovim-8072f085d2edc254334af52261c6ff68d9143834.tar.gz rneovim-8072f085d2edc254334af52261c6ff68d9143834.tar.bz2 rneovim-8072f085d2edc254334af52261c6ff68d9143834.zip |
win: stream_init() issue with tty on Windows #9884
ref #9825
Diffstat (limited to 'src/nvim/event/stream.c')
-rw-r--r-- | src/nvim/event/stream.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/event/stream.c b/src/nvim/event/stream.c index ba25b76ec7..70b1d890d6 100644 --- a/src/nvim/event/stream.c +++ b/src/nvim/event/stream.c @@ -53,9 +53,19 @@ void stream_init(Loop *loop, Stream *stream, int fd, uv_stream_t *uvstream) stream->uv.idle.data = stream; } else { assert(type == UV_NAMED_PIPE || type == UV_TTY); +#ifdef WIN32 + if (type == UV_TTY) { + uv_tty_init(&loop->uv, &stream->uv.tty, fd, 0); + uv_tty_set_mode(&stream->uv.tty, UV_TTY_MODE_RAW); + stream->uvstream = STRUCT_CAST(uv_stream_t, &stream->uv.tty); + } else { +#endif uv_pipe_init(&loop->uv, &stream->uv.pipe, 0); uv_pipe_open(&stream->uv.pipe, fd); stream->uvstream = STRUCT_CAST(uv_stream_t, &stream->uv.pipe); +#ifdef WIN32 + } +#endif } } |