Terminal control characters to xterm/mintty blocked on windows

For remote computing, I’ve been testing the use of Sixel Graphics to
conveniently see graphics in-line with a terminal session of some
sort (e.g., xterm or vt340).

This worked well on unix systems but when I tried things out on my
win10 PC I was not able to view the sixel images—instead I saw only
the characters making up the sixel data. If I output the sixel data
from the native command line and not from julia, the image is visible.

It appears that the problem is that julia on windows seems to set
up the TTY interface via some sort of console rather than by using
the standard terminal IO with control sequences. I can’t tell from
my experiments where the problem might be.

I was unable to determine a fix for the Sixel.is_sixel_supported()
routine but I did add my information to the github ticket
mintty supports sixel.

I haven’t tried WSL2 on my computer but it seems that the issue is
still present which may be because Sys.iswindows() is being used to
special case terminal handling which ignores actual terminal
capabilities.

Here is some bash code that can be used to DA queries.
I’ve hardwired in the DA1 and DA2 control sequences but
you can substitute other sequences as desired.

#!/bin/bash
#
# This shows how to use bash to send ANSI terminal control
# sequences to the underlying TTY and read the response for
# queries such as Device Attributes (DA).  If the primary
# DA includes the value 4 then sixel graphics is supported.

# Query DA 1
echo -e "\n\nQuerying primary Device Attribute for TTY"
IFS=";" read -a REPLY -s -t 1 -d "c" -p $'\e[c' >&2
echo "${#REPLY[@]}"    # How many values were returned?
echo "${!REPLY[@]}"    # What indices were set?
# Use printf with %q option to display printing and non-
# printing values returned.
for code in "${REPLY[@]}" ; do printf '%q\n' "$code" ; done

# Query DA 2
echo -e "\n\nQuerying secondary Device Attribute for TTY"
IFS=";" read -a REPLY -s -t 1 -d "c" -p $'\e[>c' >&2
echo "${#REPLY[@]}"    # How many values were returned?
echo "${!REPLY[@]}"    # What indices were set?
# Use printf with %q option to display printing and non-
# printing values returned.
for code in "${REPLY[@]}" ; do printf '%q\n' "$code" ; done
# Here is another way to output the values from the terminal
# that seems to work for a number of different shells.  It seems
# to produce output good for shell input

bash> typeset -p REPLY
declare -a REPLY=([0]=$'\E[>19' [1]="370" [2]="0")