pi-pretty-codeblocks

Hide Markdown code fences in the Pi coding-agent TUI while preserving syntax highlighting.

Packages

Package details

extension

Install pi-pretty-codeblocks from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-pretty-codeblocks
Package
pi-pretty-codeblocks
Version
0.1.0
Published
Aug 31, 2026
Downloads
229/mo · 97/wk
Author
xhq204723
License
MIT
Types
extension
Size
6.7 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "extensions"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-pretty-codeblocks

Hide Markdown code fences in the Pi coding-agent TUI using a Claude Code-like terminal presentation: syntax-highlighted code remains, while fence and language rows are hidden by default.

This extension changes display-only rendering. It does not modify the assistant message stored in the session or sent back to the model.

Features

  • Hides visible opening and closing triple-backtick or tilde fence lines.
  • Preserves OMP/Pi's existing syntax highlighting and code-block styling.
  • Handles streamed and finalized assistant messages through the Markdown component's rendered lines.
  • Language labels are hidden by default, matching Claude Code's ordinary response output.
  • Set PI_PRETTY_CODEBLOCKS_LANG=1 to show language labels.
  • Other Markdown lines are passed through unchanged.

Install

pi install npm:pi-pretty-codeblocks

Or install directly from GitHub:

pi install git:github.com/Thyguad/pi-pretty-codeblocks

Restart Pi after installation, or run /reload in an existing session.

OMP

OMP users can install the same package with:

omp install npm:pi-pretty-codeblocks

The extension is also compatible with a direct local load:

omp --extension ./extensions/pretty-codeblocks.ts

Configuration

Language labels are hidden by default. To show them:

PI_PRETTY_CODEBLOCKS_LANG=1 pi

The environment variable must be present when Pi starts. To retain Pi's default two-column code indentation:

PI_PRETTY_CODEBLOCKS_INDENT=0 pi

Compatibility

The extension targets the current Pi/OMP TUI Markdown API and uses the @oh-my-pi/* package names. It relies on a small renderer patch because Pi does not currently expose a public hook for replacing ordinary assistant Markdown rendering.

License

MIT