~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-12-16 11:39:00 UTC
  • mfrom: (4901.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20091216113900-alk0tw723aqrbn6x
(vila) Catch SIGWINCH on Unices

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
        self._term_file = term_file
249
249
        # true when there's output on the screen we may need to clear
250
250
        self._have_output = False
251
 
        # XXX: We could listen for SIGWINCH and update the terminal width...
252
 
        # https://launchpad.net/bugs/316357
253
 
        self._width = osutils.terminal_width()
254
251
        self._last_transport_msg = ''
255
252
        self._spin_pos = 0
256
253
        # time we last repainted the screen
267
264
 
268
265
    def _show_line(self, s):
269
266
        # sys.stderr.write("progress %r\n" % s)
270
 
        if self._width is not None:
271
 
            n = self._width - 1
272
 
            s = '%-*.*s' % (n, n, s)
 
267
        width = osutils.terminal_width()
 
268
        if width is not None:
 
269
            # we need one extra space for terminals that wrap on last char
 
270
            width = width - 1
 
271
            s = '%-*.*s' % (width, width, s)
273
272
        self._term_file.write('\r' + s + '\r')
274
273
 
275
274
    def clear(self):