Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

How-to: Fix Progress output in Emacs #571

@erikarvstedt

Description

@erikarvstedt

Output of std.progress and tree line graphics output of the build runner are broken in Emacs shell-mode and compilation-mode.
Here's how to fix this:

Configure Emacs

Tested with Emacs 30.1

;; Set TERM for comint-derived modes like shell-mode
(setq comint-terminfo-terminal "dumb-emacs-ansi")

;; Enable basic ANSI escape sequence support for compilation-mode
(with-eval-after-load 'compile
  (add-to-list 'compilation-environment "TERM=dumb-emacs-ansi")
  (add-hook 'compilation-filter-hook 'ansi-color-compilation-filter))

Also, add this workaround for this compilation-filter-hook bug (mailing list).

Patch Zig

Apply this patchset (diff) and build Zig. Tested with Zig 0.14.
It fixes tree line graphics and enables Emacs-compatible progress output in a single line when $TERM == dumb-emacs-ansi.
Asciinema screencast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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