summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-04-01 07:24:22 -0700
committerShawn O. Pearce <sop@google.com>2009-04-01 07:24:22 -0700
commit8f82a4f828c2765cc4585f9d749f5155f06fd9e9 (patch)
tree9eb8208cdb0e6f92db491bc9577544904624ed13
parent146fe902b7dd4a7758a8748674aa1e5d3cac2592 (diff)
downloadgit-repo-8f82a4f828c2765cc4585f9d749f5155f06fd9e9.tar.gz
Don't start the pager if stdout is a pipev1.6.4
The repo script often uses a pager by default and will produce control characters (coloring) to standard output when using the pager, even if the output is redirected to another pipe or script. This is because the pager setup checked for the terminal presence on FD 0, and in case of redirection FD 0 is still attached to the terminal. Instead require that both FD 0 and FD 1 are connected to the terminal in order to start the pager. Bug: REPO-19, b.android.com/2004 Signed-off-by: Shawn O. Pearce <sop@google.com>
-rwxr-xr-xpager.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pager.py b/pager.py
index 320131cd..714c3db5 100755
--- a/pager.py
+++ b/pager.py
@@ -22,7 +22,7 @@ active = False
22def RunPager(globalConfig): 22def RunPager(globalConfig):
23 global active 23 global active
24 24
25 if not os.isatty(0): 25 if not os.isatty(0) or not os.isatty(1):
26 return 26 return
27 pager = _SelectPager(globalConfig) 27 pager = _SelectPager(globalConfig)
28 if pager == '' or pager == 'cat': 28 if pager == '' or pager == 'cat':