~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
489
489
        raise NotBranchError("path %r is not within branch %r" % (rp, base))
490
490
 
491
491
    return os.sep.join(s)
 
492
 
 
493
 
 
494
 
 
495
def terminal_width():
 
496
    """Return estimated terminal width."""
 
497
 
 
498
    # TODO: Do something smart on Windows?
 
499
 
 
500
    # TODO: Is there anything that gets a better update when the window
 
501
    # is resized while the program is running? We could use the Python termcap
 
502
    # library.
 
503
    try:
 
504
        return int(os.environ['COLUMNS'])
 
505
    except (IndexError, KeyError, ValueError):
 
506
        return 80