Skip to content

fix: terminal Color type + wasm pointer size#1

Open
zubyul wants to merge 1 commit intomainfrom
fix/terminal-color-type-tests
Open

fix: terminal Color type + wasm pointer size#1
zubyul wants to merge 1 commit intomainfrom
fix/terminal-color-type-tests

Conversation

@zubyul
Copy link

@zubyul zubyul commented Feb 12, 2026

Problem

Color was refactored from u24 to packed struct(u32) with tag+payload, but terminal tests still pass bare hex integers (0xFF0000), causing 15 compile errors.

terminal_frame_ptr() returns u32 but @intFromPtr produces usize on 64-bit, causing 1 more error.

Fix

  • Replace bare hex color literals with Color.RED, Color.BLACK, Color.WHITE, etc.
  • Use Color{ .tag = .srgb, .payload = 0xABCDEF } for non-standard colors
  • Change terminal_frame_ptr() return type to usize

Result

zig test src/terminal_wasm.zig
All 41 tests passed.

Build summary improves from 796/797 → 797/797 tests passing (for terminal module).

Color became a packed struct(u32) with tag+payload but tests still
passed bare hex integers (0xFF0000). Replace with Color.RED etc.

Also fix terminal_frame_ptr() return type: u32 → usize for 64-bit.

All 41 terminal_wasm tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant