Re: typeout/line width: 79/80 chars

James Antill <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <[email protected]>
Paul Franklin <[email protected]> writes:

> On 9/11/09, Seth Vidal <[email protected]> wrote:
>> what version of yum were you using before? what version are you using now?
>
[...]
> So first I installed Fedora 10, whose yum was 3.2.20-3.fc10.noarch
> (before the "yum update" that is).  I first noticed it had a space
> after the "1/1" in
>
>   Installing ... : yum-plugin-fastestmirror ... 1/1
[...]
> line.  I also noticed the lines of equal signs after the
> "Dependencies Resolved" were eighty (80) characters long -- and
> similarly after the "Transaction Summary" -- so evidently the
> 80-character format was starting to appear, in that F10 yum.

 Ok, so the obvious "fix" here is to change urlgrabber (which is where
everything gets the terminal width from) to do something like:

diff --git a/urlgrabber/progress.py b/urlgrabber/progress.py
index 7dd8d6a..77db16c 100644
--- a/urlgrabber/progress.py
+++ b/urlgrabber/progress.py
@@ -36,11 +36,11 @@ def terminal_width(fd=1):
         buf = fcntl.ioctl(fd, termios.TIOCGWINSZ, buf)
         ret = struct.unpack('hhhh', buf)[1]
         if ret == 0:
-            return 80
+            return 79
         # Add minimum too?
-        return ret
+        return ret - 1
     except: # IOError
-        return 80
+        return 79
 
 _term_width_val  = None
 _term_width_last = None

...which does the simple thing of chopping a character off the width
of the screen. However I'm somewhat loath to do that for everyone,
just to fix what seems to be broken emacs terminal line wrapping.

 I assume the above patches makes everything look fine again in emacs?
 Do you know if there is a reason that emacs chops a character off the
width?

-- 
James Antill -- [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.