This should be possible via the shell option (see the docs). I've written out some preliminary code for Linux, and it seems to work as expected. I'll fix Windows compatibility and send out a PR.
Edit: bash should be the new default on Linux, cmd.exe should remain the default on Windows.