let stdout_isatty () = Unix.isatty Unix.stdout && try Unix.getenv "TERM" <> "dumb" with Not_found -> true