Add true color detection
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
				
			|||||||
LDLIBS := -lscerror -lm
 | 
					LDLIBS := -lscerror -lm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MAJOR := 1
 | 
					MAJOR := 1
 | 
				
			||||||
MINOR := 1
 | 
					MINOR := 2
 | 
				
			||||||
PATCH := 0
 | 
					PATCH := 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
GENERATELIBHEADER := 1
 | 
					GENERATELIBHEADER := 1
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -60,6 +60,12 @@ void term::progress(int prefixlen,
 | 
				
			|||||||
    *_out << ' ' << std::setw(3) << perc << '%';
 | 
					    *_out << ' ' << std::setw(3) << perc << '%';
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool term::has_truecolor() const {
 | 
				
			||||||
 | 
					    char* tc = getenv("COLORTERM");
 | 
				
			||||||
 | 
					    std::string colorterm {tc ? tc : ""};
 | 
				
			||||||
 | 
					    return colorterm.size() > 0 && (colorterm == "truecolor" || colorterm == "24bit");
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ------------------------------------------------------------------------
 | 
					// ------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cursor_hider::cursor_hider(std::ostream* out) : _out {out} {
 | 
					cursor_hider::cursor_hider(std::ostream* out) : _out {out} {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,6 +24,8 @@ namespace sc {
 | 
				
			|||||||
                          const std::string& prefix,
 | 
					                          const std::string& prefix,
 | 
				
			||||||
                          double cur,
 | 
					                          double cur,
 | 
				
			||||||
                          double total) const;
 | 
					                          double total) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            bool has_truecolor() const;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    class cursor_hider {
 | 
					    class cursor_hider {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user