mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
build: Only use ANSI colour sequences if stdout is a terminal
https://stackoverflow.com/a/10022396
This commit is contained in:
14
configure.ac
14
configure.ac
@@ -31,12 +31,14 @@ term_bold=""
|
||||
term_red=""
|
||||
term_green=""
|
||||
term_restore=""
|
||||
AS_CASE(["$TERM"],
|
||||
[xterm*|vt220*], [
|
||||
term_bold="$(printf "\e@<:@1m")"
|
||||
term_red="$(printf "\e@<:@22;31m")"
|
||||
term_green="$(printf "\e@<:@22;32m")"
|
||||
term_restore="$(printf "\e@<:@0m")"
|
||||
AS_IF([test -t 1], [
|
||||
AS_CASE(["$TERM"],
|
||||
[xterm*|vt220*], [
|
||||
term_bold="$(printf "\e@<:@1m")"
|
||||
term_red="$(printf "\e@<:@22;31m")"
|
||||
term_green="$(printf "\e@<:@22;32m")"
|
||||
term_restore="$(printf "\e@<:@0m")"
|
||||
])
|
||||
])
|
||||
m4_define([HEADING],
|
||||
[AS_ECHO
|
||||
|
||||
Reference in New Issue
Block a user