mercurial/ui.py
changeset 12689 c52c629ce19e
parent 12665 cf24b6b5517c
child 12764 ad2506f097d3
--- a/mercurial/ui.py	Thu Oct 07 23:34:21 2010 -0500
+++ b/mercurial/ui.py	Sun Oct 10 10:06:36 2010 -0500
@@ -402,6 +402,16 @@
 
         return i
 
+    def termwidth(self):
+        '''how wide is the terminal in columns?
+        '''
+        if 'COLUMNS' in os.environ:
+            try:
+                return int(os.environ['COLUMNS'])
+            except ValueError:
+                pass
+        return util.termwidth()
+
     def formatted(self):
         '''should formatted output be used?