Skip to content

cli: update list-themes preview sample to valid Zig 0.16 syntax - #14012

Merged
jcollie merged 1 commit into
ghostty-org:mainfrom
tacheraSasi:fix/list-themes-zig-0.16-demo
Aug 25, 2026
Merged

jcollie merged 1 commit into
ghostty-org:mainfrom
tacheraSasi:fix/list-themes-zig-0.16-demo

Conversation

@tacheraSasi

Copy link
Copy Markdown
Contributor

The demo code shown in the +list-themes theme preview was stale from before the Zig 0.16 migration (context: #12228). It referenced std.Io.getStdOut().writer(), which never existed in any Zig release, and pub fn main() !void. This rewrites the rendered sample to valid Zig 0.16 idioms:

const std = @import("std");

pub fn main(init: std.process.Init) !void {
    var buf: [1024]u8 = undefined;
    var stdout = std.Io.File.stdout().writer(init.io, &buf);
    const w = &stdout.interface;

    var i: usize = 1;
    while (i <= 16) : (i += 1) {
        if (i % 15 == 0) {
            try w.writeAll("ZiggZagg\n");
        } else if (i % 3 == 0) {
            try w.writeAll("Zigg\n");
        } else if (i % 5 == 0) {
            try w.writeAll("Zagg\n");
        } else {
            try w.print("{d}\n", .{i});
        }
    }
    try w.flush();
}

The gutter line numbers, row offsets, and child window height were renumbered to match, and the zig version shown in the demo prompt line was updated from v0.13.0 to v0.16.0.

@ghostty-bot ghostty-bot Bot added the cli `ghostty` command-line interface label Aug 25, 2026
@ghostty-vouch

ghostty-vouch Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Hi @tacheraSasi, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/ghostty-org/ghostty/blob/main/CONTRIBUTING.md for more details.

@ghostty-vouch ghostty-vouch Bot closed this Aug 25, 2026
@jcollie

jcollie commented Aug 25, 2026

Copy link
Copy Markdown
Member

!vouch

@ghostty-vouch ghostty-vouch Bot mentioned this pull request Aug 25, 2026
ghostty-vouch Bot added a commit that referenced this pull request Aug 25, 2026
Triggered by
[comment](#14012 (comment))
from @jcollie.

Vouch: @tacheraSasi

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jcollie jcollie reopened this Aug 25, 2026

@jcollie jcollie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI

@jcollie
jcollie merged commit b260da2 into ghostty-org:main Aug 25, 2026
104 checks passed
@github-actions github-actions Bot added this to the 1.4.0 milestone Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli `ghostty` command-line interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants