improved sudo detection
improved preview before sourcing