``TERMWIDTH``; if the function returns zero, as is reported to occur
in some pseudo-ttys, the message wrapping system is disabled in the
same way as if ``ioctl()`` failed. #172
ioctl = fcntl.ioctl(0, termios.TIOCGWINSZ,
struct.pack('HHHH', 0, 0, 0, 0))
_h, TERMWIDTH, _hp, _wp = struct.unpack('HHHH', ioctl)
+ if TERMWIDTH <= 0: # can occur if running in emacs pseudo-tty
+ TERMWIDTH = None
except (ImportError, IOError):
TERMWIDTH = None
.. changelog::
:version: 0.6.3
+ .. change::
+ :tags: bug
+ :tickets: 172
+
+ Added a workaround for when we call ``fcntl.ioctl()`` to get at
+ ``TERMWIDTH``; if the function returns zero, as is reported to occur
+ in some pseudo-ttys, the message wrapping system is disabled in the
+ same way as if ``ioctl()`` failed.
+
.. change::
:tags: feature
:tickets: 171