diff options
| author | Matthieu Coudron <mattator@gmail.com> | 2020-05-26 11:03:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-26 11:03:50 +0200 |
| commit | 618e9a769220ffe331cc554c51485f9230a544ec (patch) | |
| tree | 4ba237ecf32e967e752829fda321b805777b1622 /src/nvim/event | |
| parent | 8c588246a505e4fcd3d28e6d1f670e834c918529 (diff) | |
| parent | bb2be0de38c46f683bda45a32cf47493cf4db411 (diff) | |
| download | rneovim-618e9a769220ffe331cc554c51485f9230a544ec.tar.gz rneovim-618e9a769220ffe331cc554c51485f9230a544ec.tar.bz2 rneovim-618e9a769220ffe331cc554c51485f9230a544ec.zip | |
Merge pull request #11803 from erw7/virtual-terminal-input
[RDY] win/TUI: Use virtual terminal input if available
Diffstat (limited to 'src/nvim/event')
| -rw-r--r-- | src/nvim/event/stream.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/event/stream.c b/src/nvim/event/stream.c index 0e87f7c6c1..1e9e530a42 100644 --- a/src/nvim/event/stream.c +++ b/src/nvim/event/stream.c @@ -11,6 +11,9 @@ #include "nvim/rbuffer.h" #include "nvim/macros.h" #include "nvim/event/stream.h" +#ifdef WIN32 +# include "nvim/os/os_win_console.h" +#endif #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/stream.c.generated.h" @@ -62,6 +65,11 @@ void stream_init(Loop *loop, Stream *stream, int fd, uv_stream_t *uvstream) 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); + DWORD dwMode; + if (GetConsoleMode(stream->uv.tty.handle, &dwMode)) { + dwMode |= ENABLE_VIRTUAL_TERMINAL_INPUT; + SetConsoleMode(stream->uv.tty.handle, dwMode); + } stream->uvstream = STRUCT_CAST(uv_stream_t, &stream->uv.tty); } else { #endif |