fix: check if os.Stdin is a terminal before opening the TTY