Rev 4767: terminal_width() default to 256 for non-ttys. in file:///home/vila/src/bzr/experimental/for-babune/

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Oct 23 07:49:41 BST 2009


At file:///home/vila/src/bzr/experimental/for-babune/

------------------------------------------------------------
revno: 4767
revision-id: v.ladeuil+lp at free.fr-20091023064941-y8lyzpw883mmjlul
parent: pqm at pqm.ubuntu.com-20091022162721-r0to3zua8p8oprq1
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: for-babune
timestamp: Fri 2009-10-23 08:49:41 +0200
message:
  terminal_width() default to 256 for non-ttys.
  
  * bzrlib/osutils.py:
  (terminal_width): Use a more reasonable value
-------------- next part --------------
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py	2009-10-22 15:19:59 +0000
+++ b/bzrlib/osutils.py	2009-10-23 06:49:41 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2007, 2009 Canonical Ltd
+1# Copyright (C) 2005, 2006, 2007, 2009 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -1303,7 +1303,10 @@
         # pagers can then handle that themselves. A cleaner implementation
         # would be to fix the callers to not try to format at all in these
         # circumstances.
-        return 65536
+
+        # Note that we can't use arbitrary large values since it's used to
+        # format real lines.
+        return 256
 
     if sys.platform == 'win32':
         return win32utils.get_console_size()[0]



More information about the bazaar-commits mailing list