From 9fad72f4d8672e638a79ff3737b197f5416cca36 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 29 Aug 2023 02:04:23 +0200 Subject: Add fdterm_color() function for testing/enabling terminal color support --- libbutl/fdstream.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libbutl/fdstream.hxx') diff --git a/libbutl/fdstream.hxx b/libbutl/fdstream.hxx index 683a2f2..9c8f786 100644 --- a/libbutl/fdstream.hxx +++ b/libbutl/fdstream.hxx @@ -901,6 +901,14 @@ namespace butl LIBBUTL_SYMEXPORT bool fdterm (int); + // Test whether a terminal file descriptor supports ANSI color output. If + // the enable argument is true, then also try to enable color output (only + // applicable on some platforms, such as Windows). Throw ios::failure on the + // underlying OS error. + // + LIBBUTL_SYMEXPORT bool + fdterm_color (int, bool enable); + // Wait until one or more file descriptors becomes ready for input (reading) // or output (writing). Return the pair of numbers of descriptors that are // ready. Throw std::invalid_argument if anything is wrong with arguments -- cgit v1.1