darcs

Patch 2440 use colored output when piping it through a pager

Title use colored output when piping it through a pager
Superseder Nosy List bfrk
Related Issues
Status needs-review Assigned To
Milestone

Created on 2025-01-03.15:45:59 by bfrk, last changed 2025-01-03.15:46:54 by bfrk.

Files
File name Status Uploaded Type Edit Remove
patch-preview.txt bfrk, 2025-01-03.15:45:58 text/x-darcs-patch
use-colored-output-when-piping-it-through-a-pager.dpatch bfrk, 2025-01-03.15:45:59 application/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg24144 (view) Author: bfrk Date: 2025-01-03.15:45:59
1 patch for repository https://darcs.net/screened:

patch f5c898ae646ad951f046aa6d71cb5d4324192ba7
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Jul 14 20:00:50 CEST 2024
  * use colored output when piping it through a pager

  I previously had to set DARCS_ALWAYS_COLOR=1 to get colored output when a
  pager is invoked, which has become the rule rather than the exception. But
  that makes darcs output color codes even when the user redirects the output
  to a file, which is not something anybody wants to happen. The trick is to
  pass the printers the stdout /before/ we invoke the pager (and ignore the
  handle it gets passed later when stdout is the write end of the pipe).
Attachments
History
Date User Action Args
2025-01-03 15:45:59bfrkcreate
2025-01-03 15:46:54bfrksetstatus: needs-screening -> needs-review