Ugh, it seems that msys2/mintty sets `TERM=xterm-256color` as default. So it'd be better just to check `$MSYSCON` only, not `$TERM`.