Silently restoring .zshrc.pre-oh-my-zsh during uninstall could overwrite
years of user config with a stale backup from install time, with no
warning or recovery path. Fixes#13156, fixes#13328.
Changes:
- Clarify the timestamped backup message so users know it holds their
current config, not a throwaway file
- Show the modification date of the pre-OMZ backup before restoring it
- Prompt for confirmation before restoring; default is N (no restore)
- If user declines, print both file paths so they can merge manually
- Cross-platform date: tries macOS `date -r` then GNU `stat -c %Y`
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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