extracted code that checks for terminal support into a useable method