See T13297. Some versions of "vi" and "vim" exit with an error code if the user makes a command typo while performing an interactive edit. This can lead to discarding stuff they typed.
If we receive an error code:
- test if the binary is "vi" or "vim";
- if it is, test if "<binary> +q +Q" exits nonzero;
- if it does, ignore the error code.
This appears to be a conclusive test for "error indicates interactive command mistake".