Add webassembly support (#79)

This commit is contained in:
Arthur Sonzogni
2021-03-22 00:26:52 +01:00
committed by GitHub
parent 65c0297789
commit 373b016ca9
35 changed files with 267 additions and 47 deletions

View File

@@ -19,7 +19,7 @@ namespace ftxui {
Terminal::Dimensions Terminal::Size() {
#if defined(__EMSCRIPTEN__)
return Dimensions{80, 43};
return Dimensions{140, 43};
#elif defined(_WIN32)
CONSOLE_SCREEN_BUFFER_INFO csbi;
int columns, rows;
@@ -48,6 +48,10 @@ bool Contains(const std::string& s, const char* key) {
static bool cached = false;
Terminal::Color cached_supported_color;
Terminal::Color ComputeColorSupport() {
#if defined(__EMSCRIPTEN__)
return Terminal::Color::TrueColor;
#endif
std::string COLORTERM = Safe(std::getenv("COLORTERM"));
if (Contains(COLORTERM, "24bit") || Contains(COLORTERM, "truecolor"))
return Terminal::Color::TrueColor;