title: Is it possible to detect where output goes - to terminal or into pipe/file?
body: <p>For example, when I'm writing program that outputs text to stdout and uses colors (via escape sequences), I would like to disable those colors if output goes to other program (like <code>less</code>, <code>grep</code>) or to file, since color codes mess up the output.</p>
  
  <p>Is it possible to do it from Java process?</p>