diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2018-12-16 14:28:17 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-16 14:28:17 +0100 |
| commit | b48efd9ba7bf1d317dcf231e3e595988537a5cf9 (patch) | |
| tree | b163ad47def5a6a1aff82375e9926800308136f8 /src/nvim/tui/terminfo.c | |
| parent | cffe2d4642a7d27a76ddb5516ff9df6a4e9e494d (diff) | |
| parent | 3f55010cda120d0ccb35f9e24d93cee33f3aa17b (diff) | |
| download | rneovim-b48efd9ba7bf1d317dcf231e3e595988537a5cf9.tar.gz rneovim-b48efd9ba7bf1d317dcf231e3e595988537a5cf9.tar.bz2 rneovim-b48efd9ba7bf1d317dcf231e3e595988537a5cf9.zip | |
Merge #9347 from justinmk/tui-bsd
TUI: detect BSD vt console
Diffstat (limited to 'src/nvim/tui/terminfo.c')
| -rw-r--r-- | src/nvim/tui/terminfo.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/tui/terminfo.c b/src/nvim/tui/terminfo.c index ad86dd928b..ad57f0af7f 100644 --- a/src/nvim/tui/terminfo.c +++ b/src/nvim/tui/terminfo.c @@ -13,6 +13,7 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/option.h" +#include "nvim/os/os.h" #include "nvim/tui/terminfo.h" #include "nvim/tui/terminfo_defs.h" @@ -33,6 +34,24 @@ bool terminfo_is_term_family(const char *term, const char *family) && ('\0' == term[flen] || '-' == term[flen]); } +bool terminfo_is_bsd_console(const char *term) +{ +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) \ + || defined(__DragonFly__) + if (strequal(term, "vt220") // OpenBSD + || strequal(term, "vt100")) { // NetBSD + return true; + } +# if defined(__FreeBSD__) + // FreeBSD console sets TERM=xterm, but it does not support xterm features + // like cursor-shaping. Assume that TERM=xterm is degraded. #8644 + return strequal(term, "xterm") && !!os_getenv("XTERM_VERSION"); +# endif +#else + return false; +#endif +} + /// Loads a built-in terminfo db when we (unibilium) failed to load a terminfo /// record from the environment (termcap systems, unrecognized $TERM, …). /// We do not attempt to detect xterm pretenders here. |