updated to support Mac OS

the tput command on Mac OS returns a single character; so the test for non-interactive terminal is inappropriately setting the backspace. Fixed this by checking the OS with an if statement on line 94 and detecting the OS on line 83;