Added logic and test for case without terminal
Merge pull request #13 from jkleijn/master

Added logic and test for case without terminal (eg. Jenkins)