Hi Corinna,

On Fri, 5 Dec 2025 12:11:47 +0100
Corinna Vinschen wrote:
> On Dec  5 18:52, Takashi Yano via Cygwin wrote:
> > On Thu, 4 Dec 2025 12:01:58 +0100
> > Corinna Vinschen wrote:
> > > Aren't from here on two patches folded into one?  All but one hunk (the
> > > one calling CreatePseudoConsole_new) seem to be entirely independent of
> > > OpenConsole.
> > 
> > This part is necessary to work with OpenConsle.exe. OpenConsole.exe uses
> > also ESC[c during startup while conhost.exe uses only ESC[6n.
> 
> Ok, but ESC[c is a stock vt100 sequence.  Admittedly, I have no idea if
> there are other terminals out there which use this sequence at startup,
> too...
> 
> > > > -      static const int wpbuf_len = strlen ("\033[32768;32868R");
> > > > +      static const int wpbuf_len = 64; /* for response to CSI6n nad 
> > > > CSIc */
> > > 
> > > Is there some macro for the count of 64 in this context, by any chance?
> > 
> > I'm not sure for now that 64 is really enough for the responce to ESC[c.
> > mintty returns about 30 byte responce. But some other terminal may return
> > longer responce.
> 
> Per the vt100 documentation, the response is supposed to be
> 
>   ESC [ ? 1 ; Ps c
> 
> with Ps being a character in the range 0 - 7.
> 
> Just being curious, what are mintty and OpenConsole returning?
> 
> > > > [...]
> > > > if [ $(uname -m) = "x86_64" ]
> > > > then
> > > >         POSTFIX="x64"
> > > > else
> > > >         POSTFIX="x86"
> > > 
> > > Do we really want a 32 bit version?  Isn't there an aarch64 version?
> > 
> > No.
> 
> Weird.  But Windows on AArch64 supports a x86_64 emulation, iiuc.
> 
> > What should we assume result of "uname -m" in aarch64 machine?
> 
> "aarch64" :)
> 
> > > For a start, this may be ok, but we should really try to build our own
> > > OpenConsole package build by our own gcc or clang, IMHO.
> > 
> > OpenConsole.exe also uses WIL, so it looks not easy to build it in cygwin
> > environment.
> > 
> > Maybe just getting it from https://github.com/microsoft/wil/ is enough,
> > but I have not tried it yet.
> 
> Oh, wow!  Looks like fixes to build WIL on MingW have been merged just a
> couple of hours ago.

I've tried to build OpenConsole.exe using mingw compiler,
but it seems very hard to do that.

OpenConsole.exe depends many Libs and headers mingw compiler
does not have, such as:
winmeta.h
TraceLoggingProvider.h
TraceLoggingActivity.h
gsl/gsl_util
base/numerics/safe_math.h
fmt/compile.h
fmt/xchar.h
etc.

What about going with package attached that downloads binary
from github for now?

-- 
Takashi Yano <[email protected]>
NAME="openconsole"
VERSION=1.23.20211.0
RELEASE=1
CATEGORY="Libs"
SUMMARY="conhost.exe alternative"
DESCRIPTION="conhost.exe alternative with new features of pusedo console"
HOMEPAGE="https://github.com/microsoft/terminal/";
LICENSE="MIT"
ARCH="noarch" # This is noarch because it's just helper shell scrpits.
SRC_URI="${NAME}-${VERSION}.tar.xz"
CYGWIN_FILES="
        ${NAME}.postinstall
        ${NAME}.preremove
"

# Make dummy source file for prep
if [ ! -f ${SRC_URI} ]
then
        mkdir -p ${NAME}-${VERSION}
        tar acf ${SRC_URI} ${NAME}-${VERSION}
        rm -rf ${NAME}-${VERSION}
fi

PKG_NAMES="openconsole"
CONTENTS="etc/"
REQUIRES="wget unzip"

src_compile() {
        :
}

src_install() {
        mkdir -p ${D}/etc/${NAME}
        WT_BASENAME=Microsoft.WindowsTerminal_${VERSION}
        # Make sha256 hash
        wget -q 
${HOMEPAGE}/releases/download/v${VERSION}/${WT_BASENAME}_x64.zip -O - | 
sha256sum | sed "s/-$/${WT_BASENAME}_x64.tmp/" > 
${D}/etc/${NAME}/${WT_BASENAME}_x64.zip.sha256
        wget -q 
${HOMEPAGE}/releases/download/v${VERSION}/${WT_BASENAME}_arm64.zip -O - | 
sha256sum | sed "s/-$/${WT_BASENAME}_arm64.tmp/" > 
${D}/etc/${NAME}/${WT_BASENAME}_arm64.zip.sha256
        # Make version text
        echo ${VERSION} > ${D}/etc/${NAME}/version.txt
}
case $(uname -m) in
x86_64)
        ARCH=x64
        ;;
aarch64)
        ARCH=arm64
        ;;
*)
        # Unsupported architecture
        exit 1
        ;;
esac

VERSION=$(cat /etc/openconsole/version.txt)
WT_BASENAME=Microsoft.WindowsTerminal_${VERSION}_${ARCH}
TARGET=OpenConsole.exe

trap 'rm -f ${WT_BASENAME}.{tmp,zip}' EXIT

cd ${TMPDIR:-/tmp}
wget -q 
https://github.com/microsoft/terminal/releases/download/v${VERSION}/${WT_BASENAME}.zip
 -O ${WT_BASENAME}.tmp
if sha256sum --status -c /etc/openconsole/${WT_BASENAME}.zip.sha256
then
        mv ${WT_BASENAME}.tmp ${WT_BASENAME}.zip
        unzip -jq ${WT_BASENAME}.zip "*/${TARGET}"
        chmod 755 ${TARGET}
        mv ${TARGET} /usr/bin/.
else
        # Hash mismatch (or failed to download)
        exit 1
fi
rm -f /usr/bin/OpenConsole.exe
-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to