Skip to content

Commit

Permalink
Merge branch '1.1' into 1.2
Browse files Browse the repository at this point in the history
Conflicts:
	docs/changelog.rst
	fabric/version.py
  • Loading branch information
bitprophet committed Aug 31, 2011
2 parents 04e9063 + d4796f5 commit 4353d6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/changelog.rst
Expand Up @@ -25,6 +25,8 @@ would have also been included in the 1.2 line.
Changelog
=========

* :bug:`303` Updated terminal size detection to correctly skip over non-tty
stdout, such as when running ``fab taskname | other_command``.
* :release:`1.2.1 <2011-08-21>`
* :release:`1.1.3 <2011-08-21>`
* :release:`1.0.3 <2011-08-21>`
Expand Down
5 changes: 3 additions & 2 deletions fabric/operations.py
Expand Up @@ -40,12 +40,13 @@ def _pty_size():
local (stdout-based) terminal window size on non-Windows platforms.
"""
rows, cols = 24, 80
if not win32 and sys.stdin.isatty():
if not win32 and sys.stdout.isatty():
# We want two short unsigned integers (rows, cols)
fmt = 'HH'
# Create an empty (zeroed) buffer for ioctl to map onto. Yay for C!
buffer = struct.pack(fmt, 0, 0)
# Call TIOCGWINSZ to get window size of stdout, returns our filled buffer
# Call TIOCGWINSZ to get window size of stdout, returns our filled
# buffer
try:
result = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ,
buffer)
Expand Down

0 comments on commit 4353d6a

Please sign in to comment.