diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/terminal/line.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ui/terminal/line.cc b/src/ui/terminal/line.cc index 962b692..e668b28 100644 --- a/src/ui/terminal/line.cc +++ b/src/ui/terminal/line.cc @@ -16,6 +16,7 @@ #include <errno.h> #include <signal.h> +#include <stdlib.h> #include <sys/ioctl.h> #include <termios.h> #include <unistd.h> @@ -78,7 +79,14 @@ TerminalLine::TerminalLine() { } EnterRawMode(); - tty_ = std::make_unique<goldfishterm::SimpleTerminalOutput>(current_termios_); + + const char* terminal_name = getenv("TERM"); + if (terminal_name == nullptr) { + // Fall back to a minimal subset of the ANSI capabilities. + terminal_name = "ansi-mini"; + } + tty_ = std::make_unique<goldfishterm::SimpleTerminalOutput>( + terminal_name, current_termios_, std::cout); sigwinch_watcher_ = std::thread([this] { sigset_t sigwinch = SigsetContaining(SIGWINCH); |