Error handling for vims that don't support java or sgr, and fix bashisms