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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 588237368..01f30664f 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: namespace-profile-ghostty-windows + 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 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;