diff options
author | Bruce Momjian <bruce@momjian.us> | 2008-05-08 17:04:26 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2008-05-08 17:04:26 +0000 |
commit | 5adf98ae24fe0bef54120f378ae5f75a4f69cc6c (patch) | |
tree | e0d44b00c34f6490fd12ef57f137c6eb72e64079 /src/bin/psql/startup.c | |
parent | eb915caf92a6805740e949c3233ee32bc9676484 (diff) |
Add psql '\pset format wrapped' mode to wrap output to screen width, or
file/pipe output too if \pset columns' is set.
Bryce Nesbitt
Diffstat (limited to 'src/bin/psql/startup.c')
-rw-r--r-- | src/bin/psql/startup.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index 40359754b8b..89c3ef71a50 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2008, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.146 2008/01/01 19:45:56 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.147 2008/05/08 17:04:26 momjian Exp $ */ #include "postgres_fe.h" @@ -147,6 +147,8 @@ main(int argc, char *argv[]) pset.popt.topt.start_table = true; pset.popt.topt.stop_table = true; pset.popt.default_footer = true; + /* We must get COLUMNS here before readline() sets it */ + pset.popt.topt.env_columns = getenv("COLUMNS") ? atoi(getenv("COLUMNS")) : 0; pset.notty = (!isatty(fileno(stdin)) || !isatty(fileno(stdout))); |