patch from upstream for prompting problem when no tty associated with sudo