~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: John Arbash Meinel
  • Date: 2009-12-16 20:01:49 UTC
  • mfrom: (4903 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4904.
  • Revision ID: john@arbash-meinel.com-20091216200149-jg71giy0qp27bfv0
Merge bzr.dev 4903, resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
from shutil import (
40
40
    rmtree,
41
41
    )
 
42
import signal
42
43
import subprocess
43
44
import tempfile
44
45
from tempfile import (
1427
1428
    _terminal_size = _ioctl_terminal_size
1428
1429
 
1429
1430
 
 
1431
def _terminal_size_changed(signum, frame):
 
1432
    """Set COLUMNS upon receiving a SIGnal for WINdow size CHange."""
 
1433
    width, height = _terminal_size(None, None)
 
1434
    if width is not None:
 
1435
        os.environ['COLUMNS'] = str(width)
 
1436
 
 
1437
if sys.platform == 'win32':
 
1438
    # Martin (gz) mentioned WINDOW_BUFFER_SIZE_RECORD from ReadConsoleInput but
 
1439
    # I've no idea how to plug that in the current design -- vila 20091216
 
1440
    pass
 
1441
else:
 
1442
    signal.signal(signal.SIGWINCH, _terminal_size_changed)
 
1443
 
 
1444
 
1430
1445
def supports_executable():
1431
1446
    return sys.platform != "win32"
1432
1447