~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

Prevent linebreaks in output if it's not connected to a tty.
Works by pretending terminal width is very long.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1296
1296
 
1297
1297
def terminal_width():
1298
1298
    """Return estimated terminal width."""
 
1299
    if not sys.stdout.isatty():
 
1300
        return 10000
 
1301
 
1299
1302
    if sys.platform == 'win32':
1300
1303
        return win32utils.get_console_size()[0]
1301
1304
    width = 0