Check if the terminal is interactive and set the flags accordingly