about summary refs log tree commit diff
path: root/src/libextra/term.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libextra/term.rs')
-rw-r--r--src/libextra/term.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/libextra/term.rs b/src/libextra/term.rs
index 9a4469cb526..d448a1588a6 100644
--- a/src/libextra/term.rs
+++ b/src/libextra/term.rs
@@ -97,7 +97,7 @@ impl Terminal {
             if s.is_ok() {
                 self.out.write(s.unwrap());
             } else {
-                warn!(s.unwrap_err());
+                warn!("%s", s.unwrap_err());
             }
         }
     }
@@ -113,17 +113,22 @@ impl Terminal {
             if s.is_ok() {
                 self.out.write(s.unwrap());
             } else {
-                warn!(s.unwrap_err());
+                warn!("%s", s.unwrap_err());
             }
         }
     }
     pub fn reset(&self) {
         let mut vars = Variables::new();
-        let s = expand(*self.ti.strings.find_equiv(&("op")).unwrap(), [], &mut vars);
+        let s = do self.ti.strings.find_equiv(&("op"))
+                       .map_consume_default(Err(~"can't find terminfo capability `op`")) |&op| {
+                           expand(op, [], &mut vars)
+                       };
         if s.is_ok() {
             self.out.write(s.unwrap());
+        } else if self.num_colors > 0 {
+            warn!("%s", s.unwrap_err());
         } else {
-            warn!(s.unwrap_err());
+            debug!("%s", s.unwrap_err());
         }
     }