diff options
author | Bruce Momjian <bruce@momjian.us> | 1997-08-22 00:17:26 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1997-08-22 00:17:26 +0000 |
commit | 76501c8aed9eb7239b2d69506d70e7ebd76f335c (patch) | |
tree | 3d4744b3a1958b258236fe4c49fb0d9858dfeea1 | |
parent | 3dd23aadf0746ba53ffe3ca76863a0ffbbeb0c68 (diff) | |
download | postgresql-76501c8aed9eb7239b2d69506d70e7ebd76f335c.tar.gz postgresql-76501c8aed9eb7239b2d69506d70e7ebd76f335c.zip |
Make psql use pager only when it has a tty.
-rw-r--r-- | src/bin/psql/psql.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index f7d0245091a..b425918913b 100644 --- a/src/bin/psql/psql.c +++ b/src/bin/psql/psql.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.84 1997/08/19 21:36:51 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.85 1997/08/22 00:17:26 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -157,7 +157,9 @@ slashUsage(PsqlSettings * ps) char *pagerenv; FILE *fout; - if ((pagerenv = getenv("PAGER")) && (pagerenv[0] != '\0') && \ + if (settings.notty == 0 && + (pagerenv = getenv("PAGER")) && + (pagerenv[0] != '\0') && (fout = popen(pagerenv, "w"))) { usePipe = 1; @@ -1047,6 +1049,7 @@ do_help(const char *topic) FILE *fout; if (strcmp(topic, "*") == 0 && + (settings.notty == 0) && (pagerenv = getenv("PAGER")) && (pagerenv[0] != '\0') && (fout = popen(pagerenv, "w"))) |