Get the 'sh' from the env
Use persistent undo, when available
Some minor comment updates