From fead488d23b810de4910209c21f47adb9c101fa1 Mon Sep 17 00:00:00 2001 From: Alessandro De Blasis Date: Thu, 26 Mar 2026 02:27:32 +0100 Subject: [PATCH 1/4] ci: add full test suite for Windows Add test-windows job running zig build -Dapp-runtime=none test on windows-2025. Added to required checks. --- .github/workflows/test.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 588237368..24784a085 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -109,6 +109,7 @@ jobs: - test-fuzz-libghostty - test-lib-vt - test-macos + - test-windows - pinact - prettier - swiftlint @@ -1112,6 +1113,21 @@ jobs: - name: test run: nix develop -c zig build test --system ${{ steps.deps.outputs.deps }} + test-windows: + if: github.repository == 'ghostty-org/ghostty' && needs.skip.outputs.skip != 'true' + needs: skip + runs-on: windows-2025 + timeout-minutes: 45 + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Setup Zig + uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 + + - name: Test + run: zig build -Dapp-runtime=none test + test-i18n: strategy: fail-fast: false From 650b9d470a7b757d3875112a3895961717db5a28 Mon Sep 17 00:00:00 2001 From: Alessandro De Blasis Date: Thu, 26 Mar 2026 01:29:13 +0100 Subject: [PATCH 2/4] font: handle CRLF line endings in octants.txt parsing Trim trailing \r when splitting octants.txt by \n at comptime. On Windows, git may convert LF to CRLF on checkout, leaving \r at the end of each line. Without trimming, the parser tries to use \r as a struct field name in @field(), causing a compile error. Follows the same pattern used in x11_color.zig for rgb.txt parsing. --- .../draw/symbols_for_legacy_computing_supplement.zig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/font/sprite/draw/symbols_for_legacy_computing_supplement.zig b/src/font/sprite/draw/symbols_for_legacy_computing_supplement.zig index bd91d3925..46c7165a8 100644 --- a/src/font/sprite/draw/symbols_for_legacy_computing_supplement.zig +++ b/src/font/sprite/draw/symbols_for_legacy_computing_supplement.zig @@ -102,7 +102,14 @@ pub fn draw1CD00_1CDE5( const data = @embedFile("octants.txt"); var it = std.mem.splitScalar(u8, data, '\n'); - while (it.next()) |line| { + while (it.next()) |raw_line| { + // Trim \r so this works with both LF and CRLF line endings, + // since git may convert octants.txt to CRLF on Windows checkouts. + const line = if (raw_line.len > 0 and raw_line[raw_line.len - 1] == '\r') + raw_line[0 .. raw_line.len - 1] + else + raw_line; + // Skip comments if (line.len == 0 or line[0] == '#') continue; From dc3db7b99fc0552fcc59040122283ac4d21591bd Mon Sep 17 00:00:00 2001 From: Alessandro De Blasis Date: Thu, 26 Mar 2026 02:17:36 +0100 Subject: [PATCH 3/4] build: normalize line endings to LF across all platforms Add explicit file-type rules to .gitattributes so text files are stored and checked out with LF line endings regardless of platform. This prevents issues where Windows git (or CI actions/checkout) converts LF to CRLF, breaking comptime parsers that split embedded files by '\n' and end up with trailing '\r' in parsed tokens. Key changes: - Source code (*.zig, *.c, *.h, etc.): always LF - Config/build files (*.zon, *.nix, *.md, etc.): always LF - Text data files (*.txt): always LF (for embedded file parsing) - Windows resource files (*.rc, *.manifest): preserve as-is (native Windows tooling expects CRLF) - Binary files: explicitly marked as binary Removed the legacy rgb.txt -text rule since *.txt now handles it uniformly with code-level CRLF handling as defense-in-depth. --- .gitattributes | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 2e976e5f9..5a1f693b5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,47 @@ +#-------------------------------------------------------------------- +# Line endings +#-------------------------------------------------------------------- +# Source code - always LF +*.zig text eol=lf +*.c text eol=lf +*.h text eol=lf +*.cpp text eol=lf +*.m text eol=lf +*.swift text eol=lf +*.py text eol=lf +*.sh text eol=lf + +# Config/build files - always LF +*.zon text eol=lf +*.nix text eol=lf +*.md text eol=lf +*.json text eol=lf +*.yml text eol=lf +*.yaml text eol=lf +*.toml text eol=lf +CMakeLists.txt text eol=lf +*.cmake text eol=lf +Makefile text eol=lf + +# Text data files - always LF (embedded in Zig, parsed with \n split) +*.txt text eol=lf + +# Windows resource files - preserve as-is (native Windows tooling) +*.rc -text +*.manifest -text + +# Binary files +*.png binary +*.ico binary +*.icns binary +*.ttf binary +*.otf binary +*.glsl binary +*.blp binary + +#-------------------------------------------------------------------- +# Linguist +#-------------------------------------------------------------------- build.zig.zon.nix linguist-generated=true build.zig.zon.txt linguist-generated=true build.zig.zon.json linguist-generated=true @@ -12,4 +56,3 @@ src/font/nerd_font_attributes.zig linguist-generated=true src/font/nerd_font_codepoint_tables.py linguist-generated=true src/font/res/** linguist-vendored src/terminal/res/** linguist-vendored -src/terminal/res/rgb.txt -text From e90eebea9ddf4eaf213b00a00eefc73b9300175c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 27 Mar 2026 06:14:17 -0700 Subject: [PATCH 4/4] ci: switch to namespace image --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24784a085..01f30664f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1116,7 +1116,7 @@ jobs: test-windows: if: github.repository == 'ghostty-org/ghostty' && needs.skip.outputs.skip != 'true' needs: skip - runs-on: windows-2025 + runs-on: namespace-profile-ghostty-windows timeout-minutes: 45 steps: - name: Checkout code