more detailed debugging when terminal type cannot be found

Ref: #1060