sbtmsys2minttyterminal-color

Issue with MinTTY/MSYS2/bash and sbt showing control characters / no rich text output


A recent update (of either MinTTY/MSYS2/bash or sbt) started breaking the output of sbt such that control characters are appearing instead of displaying rich text output in the terminal:

enter image description here

From the image you can see that rich text does still work as can be seen from my prompt line, but sbt started showing control characters like ←[0m[.

I'm on windows 11 and it was working perfectly fine last week, and my TERM terminal setting is set to xterm.

After some searching, I found these two posts:

both suggesting that I should try setting my TERM to cygwin but this did not solve the issue.

Question

  1. How can I isolate where the issue is happening? I highly suspect it's an internal sbt update because the version it's indicating is 1.6.0 but the version I installed was 1.4.4 last year. I just tried uninstalling it and installing 1.6.2 via the installer but the issue still persists.

  2. Does anyone have a solution to this issue? Is it a general thing that affects certain CLIs? From the links above it looks like it used to impact gradle as well.


Solution

  • Looks like it was MinTTY or MSYS2 because an update of those fixed the issue.

    Working version of MSYS2:

    $ cat /proc/version
    MINGW64_NT-10.0-19044 version 3.3.5-341.x86_64 (@WIN-MG5BEJ9M9JD) (gcc version 11.3.0 (GCC) ) 2022-07-08 09:41 UTC
    

    and MinTTY:

    mintty version