- When uninstalling, if no original backup (.zshrc.pre-oh-my-zsh) exists,
restore the current .zshrc with Oh My Zsh lines removed
- Prevents data loss for users who installed years ago on different machines
- Keeps the timestamped backup file for safety
Fixes#13156Fixes#13328
If there's no `~/.shell.pre-oh-my-zsh`, don't assume the default choice
is Bash. In fact Zsh is the default shell for macOS since Catalina
(10.15) [1], yet users of other OSes have likely to have Bash as their
default.
This commit fix issue #8252
[1] https://support.apple.com/en-us/HT208050
* Balk at incompatible Windows/MSYS git
* Test for chsh presence before trying to use it
* Replace non-portable `[[ ... ]]` and `[ x = *pattern* ]` constructs