1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/term/can_show_color_nix.v

12 lines
192 B
V
Raw Normal View History

module term
import os
fn C.isatty(int) int
pub fn can_show_color_on_fd(fd int) bool {
if os.getenv('TERM') == 'dumb' { return false }
if C.isatty(fd) != 0 { return true }
return false
}