Skip to content

terminal renderer: inline images disabled pending Zig 0.16 env/fs API migration #57

Description

@tsunaminoai

Three code paths in src/markdown/renderers/terminal.zig were stubbed out during the Zig 0.16.0 migration:

1. detectImageProtocol() always returns .none (~line 91)

std.posix.getenv was removed in Zig 0.16. The replacement (std.process.Environ.getPosix) requires an Environ instance, which requires either:

  • Linking libc (so the C environ global is available), or
  • Accepting std.process.Init.Minimal as the main parameter (which exposes the process environ via the new ELF startup path).

On Linux without libc, Zig 0.16's start.zig passes an empty environ block unless using callMainWithArgs.

Impact: TERM, TERM_PROGRAM, KITTY_WINDOW_ID, GHOSTTY_RESOURCES_DIR cannot be read — Kitty and iTerm2/Ghostty inline image output is permanently disabled.

2. readLocalFile() always returns null (~line 116)

3. writeKittyImagePath() is a no-op (~line 153)

std.fs access now requires an io context in Zig 0.16. Both functions stub out.

Fix options

Option A (idiomatic): Update main.zig to accept std.process.Init.Minimal and thread the environ + io through to the terminal renderer.

Option B: Link libc for the native binary and use std.c.getenv. Adds a libc dep to the CLI.

Text rendering is completely unaffected; inline images simply do not display in the meantime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions