add atty support