diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 15:00:41 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 15:00:41 -0700 |
commit | 7a7f497b483cd65e340064f23ed1c73425ecba0a (patch) | |
tree | d5c99ea22a1e10300d06165f8ac96df6b0dc59e1 /src/nvim/os/tty.c | |
parent | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (diff) | |
parent | ade1b12f49c3b3914c74847d791eb90ea90b56b7 (diff) | |
download | rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.tar.gz rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.tar.bz2 rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpost
Diffstat (limited to 'src/nvim/os/tty.c')
-rw-r--r-- | src/nvim/os/tty.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/nvim/os/tty.c b/src/nvim/os/tty.c deleted file mode 100644 index e683b9383f..0000000000 --- a/src/nvim/os/tty.c +++ /dev/null @@ -1,49 +0,0 @@ -// -// Terminal/console utils -// - -#include "nvim/os/os.h" // IWYU pragma: keep (Windows) -#include "nvim/os/tty.h" - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "os/tty.c.generated.h" // IWYU pragma: export -#endif - -#ifdef MSWIN -# if !defined(ENABLE_VIRTUAL_TERMINAL_PROCESSING) -# define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 -# endif -/// Guesses the terminal-type. Calls SetConsoleMode() and uv_set_vterm_state() -/// if appropriate. -/// -/// @param[in,out] term Name of the guessed terminal, statically-allocated -/// @param out_fd stdout file descriptor -void os_tty_guess_term(const char **term, int out_fd) -{ - bool conemu_ansi = strequal(os_getenv("ConEmuANSI"), "ON"); - bool vtp = false; - - HANDLE handle = (HANDLE)_get_osfhandle(out_fd); - DWORD dwMode; - if (handle != INVALID_HANDLE_VALUE && GetConsoleMode(handle, &dwMode)) { - dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; - if (SetConsoleMode(handle, dwMode)) { - vtp = true; - } - } - - if (*term == NULL) { - if (vtp) { - *term = "vtpcon"; - } else if (conemu_ansi) { - *term = "conemu"; - } else { - *term = "win32con"; - } - } - - if (conemu_ansi) { - uv_tty_set_vterm_state(UV_TTY_SUPPORTED); - } -} -#endif |