bypass "tcgetattr: Invalid argument" error