I don’t know what’s going wrong here, but if I run the vanilla julia distribution from bash on windows, it works fine. But if I run julia with winpty, it starts printing similar control characters that you’re seeing.
That is git bash:
$ julia
julia> run(`ls`)
.
.
.
Process(`ls`, ProcessExited(0))
julia>
works fine. But
$ winpty julia
julia> run(`ls`)
.
.
.
?[0mProcess(...[some more stuff here]
[some more control characters]julia> [more control characters]
breaks. Could be a clue for you to troubleshoot further.
Newer version of Git didn’t help, but it seems like the problem occurs in Julia version 1.5.3. I quickly downloaded an arbitrarily old version of Julia and saw that it doesn’t occur in Julia version 1.1.1
On which version of Julia did you guys test this on?
Edit: ran some extra tests
works on 1.1.1
works on 1.3.1
works on 1.4.2
doesn’t work on 1.5.3 (also tested on an additional newly downloaded version)
works on 1.6.0-DEV.1564 (2020-11-24)
So whatever it is, it does seem to get fixed somewhere in 1.6
Some further investigation lead me to believe that this doesn’t have anything to do with the shell environment, but with the actual mingw binaries being executed.
For example, if I run a normal Julia session in Windows, then (correctly so) echo doesn’t work, but does work under cmd /c "echo ...". But if I run the echo.exe binary from MinGW directly, then it also leaves my REPL in an unusable state. So in this case its the actual output of the echo.exe binary that does this, not because of any runtime environment shenanigans.
When you say it works on all versions except 1.5.3, are you testing with the official julia distributions or your juliawin distributions? Because I only see a single release on the github page of juliawin and it is not clear which julia version that is.
I have now tried this with Sublime Text 4. Julia is run in Terminus, and ST is started in the git bash.
With 1.5.1 and 1.5.2, shell commands are fine; with 1.5.3 shell commands mess up the Julia prompt.
1.6 is again fine.