adding support for pseudo terminal for sudo etc.