From 660c742902e0f41898e329703a3f0c413b2016cf Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 28 Apr 2011 14:53:23 -0700 Subject: stdlib: Add a color_supported() function to Term --- src/lib/Term.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/Term.rs') diff --git a/src/lib/Term.rs b/src/lib/Term.rs index 9bf90b1c..0d925d7d 100644 --- a/src/lib/Term.rs +++ b/src/lib/Term.rs @@ -30,6 +30,10 @@ fn reset(io.buf_writer writer) { writer.write(vec('0' as u8, 'm' as u8)); } +fn color_supported() -> bool { + ret _str.eq(GenericOS.getenv("TERM"), "xterm-color"); +} + fn set_color(io.buf_writer writer, u8 first_char, u8 color) { check (color < 16u8); -- cgit v1.2.3