android-tools icon indicating copy to clipboard operation
android-tools copied to clipboard

Do not get terminal dimensions when we're piping to someone

Open benvd opened this issue 12 years ago • 0 comments

When piping to someone else, the following crash occurred:

Traceback (most recent call last):
  File "./coloredlogcat.py", line 46, in <module>
    data = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ, '1234')
IOError: [Errno 25] Inappropriate ioctl for device

This commit fixes that, and allows redirecting the output of coloredlogcat. Useful to, for instance, grep for a specific tag.

benvd avatar Feb 03 '14 09:02 benvd