From 7083da268cd623c26d24ea312f3452fd7f555f0c Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 21 Aug 2011 22:22:21 -0700 Subject: [PATCH 1/4] Dev version --- fabric/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabric/version.py b/fabric/version.py index a04382d8d3..10ff921e85 100644 --- a/fabric/version.py +++ b/fabric/version.py @@ -10,7 +10,7 @@ from os.path import abspath, dirname -VERSION = (1, 1, 3, 'final', 0) +VERSION = (1, 1, 4, 'alpha', 0) def git_sha(): From 0b63615dc8cc94e15851c5e1d114742f3cddc1bd Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Sun, 21 Aug 2011 22:21:59 -0700 Subject: [PATCH 2/4] Dev version --- fabric/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabric/version.py b/fabric/version.py index 7ef8704cbe..844664b082 100644 --- a/fabric/version.py +++ b/fabric/version.py @@ -10,7 +10,7 @@ from os.path import abspath, dirname -VERSION = (1, 0, 3, 'final', 0) +VERSION = (1, 0, 4, 'alpha', 0) def git_sha(): From f162641c1a549e95fc607cbf61af517825e90f9d Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 31 Aug 2011 13:30:25 -0700 Subject: [PATCH 3/4] Formatting --- fabric/operations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fabric/operations.py b/fabric/operations.py index 95868f7079..8a36efa5c6 100644 --- a/fabric/operations.py +++ b/fabric/operations.py @@ -45,7 +45,8 @@ def _pty_size(): 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) From c9e90afe9fb86dd41c7bc46e6eceeb690425286c Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 31 Aug 2011 13:45:04 -0700 Subject: [PATCH 4/4] Check stdout instead of stdin for tty-ness when sizing up local terminal. Fixes #303 --- docs/changelog.rst | 2 ++ fabric/operations.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index fc6ea9a81d..d308932b2b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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.0.3 <2011-08-21>` * :support:`416` Updated documentation to reflect move from Redmine to Github. * :bug:`389` Fixed/improved error handling when Paramiko import fails. Thanks diff --git a/fabric/operations.py b/fabric/operations.py index 8a36efa5c6..a08064f29f 100644 --- a/fabric/operations.py +++ b/fabric/operations.py @@ -40,7 +40,7 @@ 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!