fix #6323, fix #6314
partially fix using the repl on msys
Merge branch 'master' of https://github.com/JuliaLang/julia