From 7164d4196ace14a1acc9077a7a4d32e57131ff6e Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 23 Mar 2020 09:22:50 +0100 Subject: [PATCH v2] Document color support Add a documentation appendix that explains the PG_COLOR and PG_COLORS environment variables. --- doc/src/sgml/color.sgml | 71 ++++++++++++++++++++++++++++++++++++++ doc/src/sgml/filelist.sgml | 1 + doc/src/sgml/postgres.sgml | 1 + 3 files changed, 73 insertions(+) create mode 100644 doc/src/sgml/color.sgml diff --git a/doc/src/sgml/color.sgml b/doc/src/sgml/color.sgml new file mode 100644 index 0000000000..c30b1942a5 --- /dev/null +++ b/doc/src/sgml/color.sgml @@ -0,0 +1,71 @@ + + + + Color Support + + + color + + + + Most programs in the PostgreSQL package can produce colorized console + output. This appendix describes how that is configured. + + + + When Color is Used + + + To use colorized output, set the environment variable + PG_COLORPG_COLOR + as follows: + + + + + If the value is always, then color is used. + + + + + + If the value is auto and the standard error stream + is associated with a terminal device, then color is used. + + + + + + Otherwise, color is not used. + + + + + + + + Configuring the Colors + + + The actual colors to be used are configured using the environment variable + PG_COLORSPG_COLORS + (note plural). The value is a colon-separated list of + key=value + pairs. The keys specify what the color is to be used for. The values are + SGR (Select Graphic Rendition) specifications, which are interpreted by the + terminal. + + + + The default value is error=01;31:warning=01;35:locus=01. + + + + + This color specification format is also used by other software packages + such as GCC, GNU + coreutils, and GNU grep. + + + + diff --git a/doc/src/sgml/filelist.sgml b/doc/src/sgml/filelist.sgml index 3da2365ea9..1043d0f7ab 100644 --- a/doc/src/sgml/filelist.sgml +++ b/doc/src/sgml/filelist.sgml @@ -170,6 +170,7 @@ + diff --git a/doc/src/sgml/postgres.sgml b/doc/src/sgml/postgres.sgml index e59cba7997..1f7bd32878 100644 --- a/doc/src/sgml/postgres.sgml +++ b/doc/src/sgml/postgres.sgml @@ -278,6 +278,7 @@ Appendixes &docguide; &limits; &acronyms; + &color; -- 2.25.0