X-Git-Url: https://ruderich.org/simon/gitweb/?p=safcm%2Fsafcm.git;a=blobdiff_plain;f=cmd%2Fsafcm%2Fterm.go;h=47f7d62cc1b14fe0ddbe3239d597e1d9f4b68ecc;hp=d7568e47c4d6dd7b80576011d1aa19e446bb14ba;hb=5d6cc7f14a4bacc36bf3a23cd735a75ad4a90f1d;hpb=d56dba0752e6b7d2dcac2c0d0e2e3ccddf80cd2a diff --git a/cmd/safcm/term.go b/cmd/safcm/term.go index d7568e4..47f7d62 100644 --- a/cmd/safcm/term.go +++ b/cmd/safcm/term.go @@ -57,7 +57,8 @@ func ColorString(isTTY bool, color Color, x string) string { var escapeRegexp = regexp.MustCompile(`[\x00-\x08\x0B-\x1F\x7F]`) // EscapeControlCharacters escapes all ASCII control characters (except -// newline and tab) by replacing them with their hex value. +// newline and tab) by replacing them with their hex value. If the output is +// to a TTY then the escaped characters are colored. // // This function must be used when displaying any input from remote hosts to // prevent terminal escape code injections.