diff options
author | Rui Abreu Ferreira <raf-ep@gmx.com> | 2017-03-18 00:06:47 +0000 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-05-03 12:48:24 +0200 |
commit | 685ca180f7c96f77a79c78d3b26bd003f8cd834c (patch) | |
tree | c8f74f7e9ca99ee323c7b25d3f4fc144962a7ac2 /src/nvim/tui/input.c | |
parent | 31e5053253e1b341b341e772fa7f2e24d75488d3 (diff) | |
download | rneovim-685ca180f7c96f77a79c78d3b26bd003f8cd834c.tar.gz rneovim-685ca180f7c96f77a79c78d3b26bd003f8cd834c.tar.bz2 rneovim-685ca180f7c96f77a79c78d3b26bd003f8cd834c.zip |
win: Terminal UI #6315
For CI builds unibilium is provided through msys2 packages, and
libtermkey is built from source in third-party from equalsraf/libtermkey.
In Windows we cannot read terminal input from the stdin file descriptor,
instead use libuv's uv_tty API. It should handle key input and encoding.
The UI suspend is not implemented for Windows, because the
SIGSTP/SIGCONT do not exist in windows. Currently this is a NOOP.
Closes #3902
Closes #6640
Diffstat (limited to 'src/nvim/tui/input.c')
-rw-r--r-- | src/nvim/tui/input.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index 3d37fabeee..03587d68f0 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -47,7 +47,13 @@ void term_input_init(TermInput *input, Loop *loop) int curflags = termkey_get_canonflags(input->tk); termkey_set_canonflags(input->tk, curflags | TERMKEY_CANON_DELBS); // setup input handle +#ifdef WIN32 + uv_tty_init(loop, &input->tty_in, 0, 1); + uv_tty_set_mode(&input->tty_in, UV_TTY_MODE_RAW); + rstream_init_stream(&input->read_stream, &input->tty_in, 0xfff); +#else rstream_init_fd(loop, &input->read_stream, input->in_fd, 0xfff); +#endif // initialize a timer handle for handling ESC with libtermkey time_watcher_init(loop, &input->timer_handle, input); } |