Skip to content

Add OctantCanvas#9

Open
eschnett wants to merge 14 commits into
kahliburke:mainfrom
eschnett:eschnett/octant-canvas
Open

Add OctantCanvas#9
eschnett wants to merge 14 commits into
kahliburke:mainfrom
eschnett:eschnett/octant-canvas

Conversation

@eschnett

@eschnett eschnett commented Mar 4, 2026

Copy link
Copy Markdown

Closes #4.

Copilot AI and others added 13 commits March 1, 2026 19:56
Co-authored-by: kahliburke <399121+kahliburke@users.noreply.github.com>
…indows-display

Fix silent display failure on Windows by replacing /dev/tty with stdout fallback
POSIX shm segments created for Kitty t=s transmission were never
unlinked from our side — we relied on the terminal to do it. If the
terminal doesn't support t=s (e.g. WezTerm misdetected as Kitty),
crashes, or doesn't handle it correctly, segments leak permanently.
On macOS there is no easy way to list POSIX shm segments, so leaked
segments can only be cleaned up by probing known name patterns.

Add two-generation tracking: segments created this frame go into
_KITTY_SHM_CURRENT, promoted to _KITTY_SHM_PREVIOUS at the start of
the next frame. The old previous generation is unlinked then — giving
the terminal a full frame interval to open each segment. Naturally
scales with the number of image widgets per frame.

Cleanup hooks in draw!() (per-frame), leave_tui!() (TUI exit),
prepare_for_exec!() (process replacement), and atexit (process exit).

Also adds:
- test/test_kitty_shm_stress.jl — multi-widget stress test (pixel/raw modes)
- test/cleanup_shm.jl — utility to scan for and unlink leaked segments
- Move diagnostic scripts from demos/ to test/

Fixes kahliburke#6
WezTerm supports sixel but not Kitty graphics. It responds to the
Kitty graphics protocol query in a way that causes misdetection,
which previously caused shm segment leaks. Check TERM_PROGRAM and
skip the Kitty query entirely for WezTerm, defaulting to sixel.

Fixes kahliburke#7
- Fix "octan_backend"/"octand_backend" typos in load_render_backend!
- Fix dots field comment: 8-bit octant masks, not 4-bit quadrant
- Fix doc widget tag: canvas_octant instead of canvas_block
- Update settings adjust test for 3-element backend cycle
@kahliburke

Copy link
Copy Markdown
Owner

I took a look and make a few fixes ... issue I'm having is that out of the box I got ? blocks rendered which I take it was due to a font. I tried to find a font which supported these characters, found a gnu unifont through home-brew, went into settings to configure this as a fallback for non ascii characters, and ... it just doesn't kook very good to me? Is there a different setting or font? What are you seeing? I tried wezterm and set the configuration for it as described in the release docs, but still not working for me?

image

- create_canvas returns OctantCanvas when octant_backend is active
- Settings overlay displays "octant" and cycles through it
- Backend demo uses 2x2 grid: braille, block, octant, pixel
- Add terminal rendering benchmark script
@eschnett

eschnett commented Mar 5, 2026

Copy link
Copy Markdown
Author

I see. In your setup, octants are clearly unusable. I attach a screen shot from my system:

Screenshot 2026-03-05 at 08 12 35

I am using JuliaMono as font. It has support for the octant characters. In addition, WezTerm special-cases "graphics characters" (line- and block-drawing characters) and renders them not via the font but directly, ensuring they look good (they are supported, there are no gaps, lines match up, etc.).

Octants were only added to Unicode 16, which was released in autumn 2024. I guess it has not yet permeated the computing ecosystem yet.

@kahliburke

kahliburke commented Mar 5, 2026

Copy link
Copy Markdown
Owner

I will take a look at JuliaMono and see if that changes the rendering. Also, my dark theme bias is showing here, I hadn't noticed that the pixel graphics enforced dark theme ... perhaps something to fix. :)

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.

Provide OctantCanvas?

4 participants