Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/actions/spelling/allow/allow.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
AABBGGRR
BBX
CLSCTX
COLRv
DWIDTH
ENDCHAR
ENDFONT
ENDPROPERTIES
FONTBOUNDINGBOX
FreeBSD
HKCR
IClass
ITerminal
LASTEXITCODE
MULTIPLEUSE
NOAGGREGATION
NOINTERFACE
OPENCONSOLE
OpenBSD
REFIID
REGCLS
SEMA
STARTCHAR
STARTFONT
STARTPROPERTIES
STDMETHODCALLTYPE
SWIDTH
Unknwn
Unpremultiply
UpperCamelCase
XBase
XCount
YBase
YCount
aea
appleclang
bdf
Expand All @@ -38,6 +51,9 @@ nupkg
nushell
openxr
ppem
ppv
psz
riid
tablegen
vswhere
zypper
62 changes: 62 additions & 0 deletions cmake/presets/os-windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,42 @@
"value": "x64",
"strategy": "external"
}
},
{
"name": "windows-msvc-ninja-debug",
"inherits": [
"windows-common",
"debug"
],
"displayName": "Windows (MSVC+Ninja) Debug",
"description": "Using MSVC compiler with Ninja generator",
"generator": "Ninja",
"architecture": {
"value": "x64",
"strategy": "external"
},
"toolset": {
"value": "host=x64",
"strategy": "external"
}
},
{
"name": "windows-msvc-ninja-release",
"inherits": [
"windows-common",
"release"
],
"displayName": "Windows (MSVC+Ninja) Release",
"description": "Using MSVC compiler with Ninja generator",
"generator": "Ninja",
"architecture": {
"value": "x64",
"strategy": "external"
},
"toolset": {
"value": "host=x64",
"strategy": "external"
}
}
],
"buildPresets": [
Expand All @@ -109,6 +145,18 @@
"displayName": "x64 (ClangCL) RelWithDebInfo",
"configurePreset": "clangcl-release",
"configuration": "RelWithDebInfo"
},
{
"name": "windows-msvc-ninja-debug",
"displayName": "x64 (MSVC+Ninja) Debug",
"configurePreset": "windows-msvc-ninja-debug",
"configuration": "Debug"
},
{
"name": "windows-msvc-ninja-release",
"displayName": "x64 (MSVC+Ninja) RelWithDebInfo",
"configurePreset": "windows-msvc-ninja-release",
"configuration": "RelWithDebInfo"
}
],
"testPresets": [
Expand Down Expand Up @@ -149,6 +197,20 @@
"Debug"
],
"configurePreset": "msvc-debug"
},
{
"name": "windows-msvc-ninja-debug",
"configurations": [
"Debug"
],
"configurePreset": "windows-msvc-ninja-debug"
},
{
"name": "windows-msvc-ninja-release",
"configurations": [
"RelWithDebInfo"
],
"configurePreset": "windows-msvc-ninja-release"
}
]
}
1 change: 1 addition & 0 deletions metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
<li>Adds VT sequences for double width / double height lines, `DECDHL`, `DECDWL`, `DECSWL` (#137)</li>
<li>Adds VT sequence extension OSC 133 shell integration (#793)</li>
<li>Adds support for rendering COLRv1 fonts (e.g. new Google Noto Color Emoji)</li>
<li>Adds Contour Terminal to the list of possible default terminals on Windows 11 (#605)</li>
<li>Drop Qt5 support</li>
</ul>
</description>
Expand Down
94 changes: 94 additions & 0 deletions patch_openconsole.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@

Check failure on line 1 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`openconsole` is not a recognized word. (check-file-path)
import sys
import struct

def guid_to_bytes(guid_str):
# UUID format: 2EACA947-7F5F-4CFA-BA87-8F7FBEEFBE69

Check failure on line 6 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`FBEEFBE` is not a recognized word. (unrecognized-spelling)

Check failure on line 6 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`EACA` is not a recognized word. (unrecognized-spelling)
parts = guid_str.replace('-', '').replace('{', '').replace('}', '')
d1 = int(parts[0:8], 16)
d2 = int(parts[8:12], 16)
d3 = int(parts[12:16], 16)
d4s = parts[16:]
d4 = [int(d4s[i:i+2], 16) for i in range(0, 16, 2)]

# Struct: DWORD, WORD, WORD, BYTE[8]
# Little endian for first 3
return struct.pack('<IHH', d1, d2, d3) + bytes(d4)

Check failure on line 16 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`IHH` is not a recognized word. (unrecognized-spelling)

def patch_file(input_path, output_path):
print(f"Reading {input_path}...")
with open(input_path, 'rb') as f:
data = f.read()

# CLSIDs

Check failure on line 23 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`CLSIDs` is not a recognized word. (unrecognized-spelling)
org_clsid_str = "2EACA947-7F5F-4CFA-BA87-8F7FBEEFBE69"

Check warning on line 24 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`FBEEFBE` is not a recognized word. (unrecognized-spelling)

Check warning on line 24 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`EACA` is not a recognized word. (unrecognized-spelling)
new_clsid_str = "F00DCAFE-0000-0000-0000-000000000001"

Check failure on line 25 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`DCAFE` is not a recognized word. (unrecognized-spelling)

org_bytes = guid_to_bytes(org_clsid_str)
new_bytes = guid_to_bytes(new_clsid_str)

print(f"Original GUID Bytes: {org_bytes.hex()}")
print(f"New GUID Bytes: {new_bytes.hex()}")

# 1. Patch RAW GUID BYTES
count = data.count(org_bytes)
print(f"Found {count} instances of raw GUID bytes.")
if count > 0:
data = data.replace(org_bytes, new_bytes)
print("Replaced raw GUID bytes.")

# 2. Patch UTF-16LE String "{GUID}"
org_wstr = f"{{{org_clsid_str}}}".encode('utf-16le')

Check failure on line 41 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`wstr` is not a recognized word. (unrecognized-spelling)
new_wstr = f"{{{new_clsid_str}}}".encode('utf-16le')

Check warning on line 42 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`wstr` is not a recognized word. (unrecognized-spelling)

count_w = data.count(org_wstr)

Check warning on line 44 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`wstr` is not a recognized word. (unrecognized-spelling)
print(f"Found {count_w} instances of UTF-16LE string.")
if count_w > 0:
data = data.replace(org_wstr, new_wstr)

Check warning on line 47 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`wstr` is not a recognized word. (unrecognized-spelling)

Check warning on line 47 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`wstr` is not a recognized word. (unrecognized-spelling)
print("Replaced UTF-16LE strings.")

# 2b. Patch UTF-16LE String "GUID" (no braces) - Just in case
org_wstr_nb = f"{org_clsid_str}".encode('utf-16le')
new_wstr_nb = f"{new_clsid_str}".encode('utf-16le')

count_w_nb = data.count(org_wstr_nb)
print(f"Found {count_w_nb} instances of UTF-16LE string (no braces).")
if count_w_nb > 0:
# Avoid double replacing if brace version covered it?
# replace() handles it, but safer to do brace version first (more specific).
# Check if any left
if data.count(org_wstr_nb) > 0:
data = data.replace(org_wstr_nb, new_wstr_nb)
print("Replaced UTF-16LE strings (no braces).")

# 3. Patch ASCII String "{GUID}"
org_astr = f"{{{org_clsid_str}}}".encode('ascii')
new_astr = f"{{{new_clsid_str}}}".encode('ascii')

count_a = data.count(org_astr)
print(f"Found {count_a} instances of ASCII string.")
if count_a > 0:
data = data.replace(org_astr, new_astr)
print("Replaced ASCII strings.")

# 3b. Patch ASCII String "GUID" (no braces)
org_astr_nb = f"{org_clsid_str}".encode('ascii')
new_astr_nb = f"{new_clsid_str}".encode('ascii')

count_a_nb = data.count(org_astr_nb)
print(f"Found {count_a_nb} instances of ASCII string (no braces).")
if count_a_nb > 0:
data = data.replace(org_astr_nb, new_astr_nb)
print("Replaced ASCII strings (no braces).")

print(f"Writing {output_path}...")
with open(output_path, 'wb') as f:
f.write(data)
print("Done.")

if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage: patch_openconsole.py <input> <output>")

Check failure on line 91 in patch_openconsole.py

View workflow job for this annotation

GitHub Actions / Check spelling

`openconsole` is not a recognized word. (unrecognized-spelling)
sys.exit(1)

patch_file(sys.argv[1], sys.argv[2])
Loading
Loading