TUI: detect BSD vt console

FreeBSD console sets TERM=xterm, but it does not support xterm features
like cursor-shaping. GUI terminals typically set TERM=xterm-256color, so
on FreeBSD we can guess that TERM=xterm is the degraded vt.

OpenBSD console sets TERM=vt220
https://github.com/openbsd/src/blob/master/etc/etc.amd64/ttys

NetBSD console sets TERM=vt100
https://github.com/NetBSD/src/blob/trunk/etc/etc.amd64/ttys

closes #8644
This commit is contained in:
Justin M. Keyes
2018-12-11 02:04:29 +01:00
parent 5e8f2048b5
commit ab7da4c531
3 changed files with 28 additions and 7 deletions

View File

@@ -12,7 +12,7 @@
#include <sys/ioctl.h>
// forkpty is not in POSIX, so headers are platform-specific
#if defined(__FreeBSD__) || defined (__DragonFly__)
#if defined(__FreeBSD__) || defined(__DragonFly__)
# include <libutil.h>
#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
# include <util.h>