diff options
| author | Patrick Walton <[email protected]> | 2011-04-28 14:53:23 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-04-28 14:54:00 -0700 |
| commit | 660c742902e0f41898e329703a3f0c413b2016cf (patch) | |
| tree | 55e7db85038e3a0dce7ee74fdf54800c47cb42c0 /src/lib/Term.rs | |
| parent | Change vec-ref-count to handle 1 or 2, so long as non-leaky and non-creeping.... (diff) | |
| download | rust-660c742902e0f41898e329703a3f0c413b2016cf.tar.xz rust-660c742902e0f41898e329703a3f0c413b2016cf.zip | |
stdlib: Add a color_supported() function to Term
Diffstat (limited to 'src/lib/Term.rs')
| -rw-r--r-- | src/lib/Term.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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); |