summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* feat: emit OSC 66 for heading overlayscashmere2026-03-291-5/+325
| | | | | | | | | | | | | | | | | | | | | | | Add the OSC 66 emission pipeline (Step 5 of incremental plan): - kitty-gfx--place-heading: emits \e]66;s=S:n=N:d=D;TEXT\a with SGR bold + 24-bit foreground color at cached terminal position - kitty-gfx--erase-heading: erases multicell blocks by writing spaces at the topmost row (overwrite Rules 2-3) - kitty-gfx--refresh-heading-overlay: phase 1 computes position, erases on move/hide, caches new position (no emission) - kitty-gfx--emit-heading-overlays: phase 2 walks all buffers, emits OSC 66 for visible heading overlays after all posn-at-point queries complete (prevents redraw-induced multicell destruction) Two-phase refresh in kitty-gfx--refresh: phase 1 (walk-windows) does position queries and image placements, phase 2 (after loop) emits all heading OSC 66 sequences. Both phases run inside synchronized output (BSU/ESU) to prevent flicker. Also adds org-mode integration hooks (heading-modified debounce, org-mode-hook for auto-apply, heading scan/remove commands) and self-tests for place-heading and erase-heading in dry-run mode.
* feat: add heading overlay creation and org-mode integrationcashmere2026-03-291-0/+208
| | | | | | | | | | | | | | | | | - Add kitty-gfx--make-heading-overlay with display property (spaces), after-string (vertical space), modification hooks, and full heading property schema - Add kitty-gfx--org-apply-heading-sizes to scan org headings and create scaled overlays from kitty-gfx-heading-scales alist - Add kitty-gfx-org-heading-sizes interactive toggle command - Add kitty-gfx--refresh-heading-overlay stub (position tracking only, no OSC 66 emission yet) - Dispatch heading vs image overlays in kitty-gfx--refresh-overlay - Add org-mode-hook for auto heading sizes (kitty-gfx-heading-sizes-auto) - Add heading rescan timer for debounced re-scan after edits - Forward-declare org-get-heading, org-link-display-format, org-current-level - Fix kitty-gfx--heading-sgr to handle undefined faces in batch mode - Add heading overlay self-tests (creation, properties, after-string)
* feat: add OSC 66 text sizing protocol detectioncashmere2026-03-291-5/+95
| | | | | | | | | | - Add kitty-gfx--query-text-sizing-support using CPR probing (3 cursor position reports interleaved with OSC 66 tests) - Detect scale, width-only, or no support - Wire detection into kitty-graphics-mode enable (Kitty backend only) - Reset detection cache on mode disable - Update modeline lighter: KittyGfx[K+T] when text sizing available - Update enable message to mention text sizing when detected
* feat: add dry-run mode, scale decomposition, and self-test infrastructurecashmere2026-03-291-26/+173
| | | | | | | | | | | | | - Add kitty-gfx--dry-run variable and kitty-gfx--terminal-send wrapper that routes all terminal escape output through a single function, logging sequences in dry-run mode for batch debugging - Replace 9 bare send-string-to-terminal call sites with wrapper - Add kitty-gfx--decompose-scale for OSC 66 parameter computation - Add kitty-gfx--validate-osc66 for protocol param validation - Add kitty-gfx--heading-sgr for org-level-N face color extraction - Add kitty-gfx-run-self-tests with 15+ assertions for batch testing - Add kitty-gfx-heading-scales and kitty-gfx-heading-sizes-auto defcustoms - Add kitty-gfx--text-sizing-support state variable
* feat: add Sixel graphics backend with protocol auto-detectioncashmere2026-03-294-125/+1090
|\ | | | | | | | | | | | | | | | | | | | | - Introduce alist-based backend dispatch (kitty/sixel) - Add Sixel encoding via ImageMagick with temp-file cache - Auto-detect protocol: try Kitty first, then Sixel - Add kitty-gfx-preferred-protocol defcustom - Sixel erase via space-overwriting (stateless protocol) - Cleanup temp files on kill-emacs - Update README and AGENTS.md for multi-protocol support - Bump version to 0.3.0
| * fix: force redisplay before position queries to fix initial image placementcashmere2026-03-201-39/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After org-toggle-inline-images creates overlays with multi-line display properties, posn-at-point still sees pre-overlay layout because Emacs hasn't recomputed pixel positions yet. This caused images to appear ~4 rows too low on initial render (scrolling would fix it). Adding (redisplay t) at the start of kitty-gfx--refresh forces a full layout recomputation so position queries return correct values immediately. Also includes: simplified column calculation using window-body-edges, stderr suppression in call-process, debug state inspection commands, and ImageMagick binary preference fixes.
| * docs: update AGENTS.md for Sixel backend architecturecashmere2026-03-201-0/+267
| | | | | | | | | | | | | | | | | | - Document backend dispatch system (alist-based, detect-protocol) - Update architecture section with Kitty vs Sixel pipeline - Add Sixel-compatible terminals to testing/dependencies - Note Sixel limitations (256 colors, stateless) - Track org-mode misplacement bug as WIP - Bump documented version to 0.3.0
| * docs: update README for Sixel backend and multi-protocol supportcashmere2026-03-201-29/+41
| | | | | | | | | | | | | | | | | | - Mention Kitty + Sixel in title and overview - List Sixel-compatible terminals (foot, Konsole, xterm, mlterm, mintty) - Document auto-detection order and kitty-gfx-preferred-protocol defcustom - Simplify installation guard to (not (display-graphic-p)) - Add backend-specific sections to How It Works - Update Known Limitations for both protocols
| * chore: bump version to 0.3.0cashmere2026-03-201-1/+1
| | | | | | | | | | Sixel backend support is a new minor feature (new protocol, new terminals supported, new defcustom). No breaking changes to public API.
| * feat: add Sixel graphics backend with protocol auto-detectioncashmere2026-03-201-65/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce backend dispatch architecture so the package supports multiple terminal graphics protocols. Existing Kitty protocol code is extracted into a `kitty` backend; a new `sixel` backend enables ~20 additional terminals (foot, Konsole, xterm, mlterm, mintty, VS Code Terminal). Key changes: - Alist-based backend dispatch (`kitty-gfx--backends`, `kitty-gfx--backend-fn`) - Kitty backend: detect/prepare/place/delete/cleanup extracted from inline code - Sixel backend: ImageMagick-based encoding, temp-file cache, DCS emission - Auto-detection (`kitty-gfx--detect-protocol`): tries Kitty first, then Sixel - `kitty-gfx-preferred-protocol` defcustom for user override (auto/kitty/sixel) - Mode-line indicator shows active backend: [K], [S], or [?] - Fix obsolete `when-let` → `when-let*` (zero byte-compile warnings) All integration points (org, image-mode, shr, dired, doc-view) dispatch through the backend interface — no mode-specific changes needed.
| * docs: add Sixel expansion plan from CEO-mode reviewcashmere2026-03-201-0/+298
|/ | | | | | | Complete architecture review for adding Sixel graphics protocol support. Documents all key decisions: alist backend dispatch, temp-file cache, dirty-flag refresh, sync encoding with debounce. Estimated 3-5 days, +300-400 LOC, unlocking ~20 additional terminals including tmux.
* Merge pull request #3 from Lenbok/agent-shell-supportcashmeredev2026-03-171-0/+46
|\ | | | | feat: support images in agent-shell sessions
| * feat: support images in agent-shell sessionsLenbok2026-03-121-0/+46
|/
* fix: reuse placement ID on zoom to avoid WezTerm visual glitchescashmere2026-03-101-34/+55
| | | | | | | | | | | When zooming in image-mode or doc-view, reuse the existing placement ID instead of deleting and re-placing. This lets the terminal atomically replace the old placement (same PID, new dimensions) without a delete step, working around WezTerm rendering artifacts (wezterm#5892). Kitty handles this perfectly. WezTerm still shows minor artifacts on zoom-in (larger replacement) but zoom-out is clean. This is a WezTerm-side bug.
* feat: robustness overhaul — LRU cache, better error handling, reduced flickerv0.2.1cashmere2026-02-271-202/+494
| | | | | | | | | | | | | | | | | - LRU image cache with configurable size and eviction (kitty-gfx-cache-size) - Cache stores only image IDs; dimensions computed fresh each time - Leading-edge debounce for faster initial refresh response - Targeted placement deletion on buffer/window change (no more delete-all flicker) - Cell pixel size re-queried on window resize - Image overflow check prevents visual corruption at window bottom - convert-to-png returns nil on failure instead of passing non-PNG data - unwind-protect for temp file cleanup in display-image paths - kill-buffer-hook checks cross-buffer image sharing before deleting - ignore-errors around all send-string-to-terminal calls - Millisecond-precision debug logging throughout - Dead overlay pruning in refresh cycle - GIF removed from supported formats (multi-frame issues) - Window-size-change hook in image-mode for split/unsplit re-render
* chore: update URL to GitHub repositorycashmere2026-02-271-1/+1
|
* fix: image-mode compatibility with evil-mode and centered image positioningcashmere2026-02-261-8/+42
| | | | | | | | | | | | - Use kitty-gfx-image-mode major-mode to avoid evil-collection overriding zoom keybindings with native image functions that fail in terminal - Add evil normal-state bindings for +/=/-/0/q when evil is loaded - Use special-mode-map as parent instead of image-mode-map to prevent image-mode-window-put and image--change-size errors - Fix centered image column calculation: detect when posn-col-row is inflated by overlay display properties and fall back to body-left - Clear buffer-modified-p after image-mode renders - Add debug logging to centered display and image-mode-render paths
* docs: update README with LaTeX preview, doc-view, zoom, new defaultscashmere2026-02-261-6/+16
| | | | | | | | | | - Add org LaTeX preview and doc-view to integrations list - Add usage instructions for LaTeX (C-c C-x C-l) and doc-view (n/p navigation, +/-/0 zoom) - Update customization table: max-width 120, max-height 40 - Add LaTeX (texlive+dvipng) and doc-view (ghostscript) to requirements - Note doc-view centering flash as known limitation
* feat: add image-mode centering and zoom controlscashmere2026-02-261-6/+43
| | | | | | | | | | | | Images in image-mode now display centered in the window with +/-/0 keybindings for zoom in/out/reset. - Add kitty-gfx--image-scale buffer-local variable - Add kitty-gfx--image-mode-render for centered display at scale - Add kitty-gfx-image-increase-size (1.25x per press) - Add kitty-gfx-image-decrease-size (0.8x per press) - Add kitty-gfx-image-reset-size (back to 1.0) - Bind +/-/0 in the image-mode keymap
* feat: add doc-view integration for PDF viewing with zoomcashmere2026-02-261-0/+91
| | | | | | | | | | | | | PDFs now render via Kitty graphics in terminal doc-view-mode. Pages display centered in the window with n/p navigation and +/-/0 zoom controls. - Advise doc-view-mode-p to bypass display-graphic-p guard while preserving per-type tool availability checks - Advise doc-view-insert-image to render pages via Kitty using the centered display helper with zoom scale - Advise doc-view-enlarge and doc-view-scale-reset to update the buffer-local scale factor and re-render
* feat: add centered display helper, bump default sizes, relax refreshcashmere2026-02-261-6/+53
| | | | | | | | - Add kitty-gfx--display-image-centered: centers images in the window with optional zoom scale parameter for full-window modes - Bump kitty-gfx-max-width 80->120, kitty-gfx-max-height 24->40 - Relax refresh visibility check to only require overlay start on screen (allows images larger than window for zoom-in)
* feat: add LaTeX fragment preview in org-mode via Kitty graphicscashmere2026-02-262-1/+92
| | | | | | | | | | | | | C-c C-x C-l now renders LaTeX fragments as images in terminal Emacs. Bypasses org's display-graphic-p guard since the latex+dvipng pipeline works fine without a GUI. - Advise org-latex-preview to handle terminal color fallbacks (unspecified-fg -> Black) and suppress clear-image-cache - Advise org--make-preview-overlay to display generated PNGs via kitty-gfx-display-image instead of Emacs image specs - Add kitty-gfx--org-clear-latex-preview for C-u cleanup - Add LaTeX test fragments to test-kitty-gfx.org
* fix: hide images when org headings are collapsedcashmere2026-02-261-3/+53
| | | | | | | | | | | | Add fold-aware visibility detection so images disappear when their containing heading is folded and reappear when expanded. - Add kitty-gfx--in-folded-region-p: checks org-fold (9.6+) then falls back to overlay-based invisibility, ignoring cosmetic org-link bracket hiding - Update kitty-gfx--overlay-screen-pos to skip folded overlays - Add kitty-gfx--on-org-cycle hook: deletes terminal placements before clearing cache, then schedules refresh
* chore: move test files to tests/ and add dev environmentcashmere2026-02-265-0/+4
| | | | | | | - Move test-image.png, test-kitty-gfx.org to tests/ - Add test-document.pdf (3-page PDF for doc-view testing) - Add .envrc for nix flake dev environment - Update .gitignore (ltximg/, Emacs lock files, AGENTS.md)
* Add demo filescashmere2026-02-245-0/+36
|
* feat: Add README.org and kitty-graphics.elcashmere2026-02-242-22/+30
|
* Add cell size query, synchronized output, and dirvish integrationcashmere2026-02-242-74/+242
| | | | | | | | | | | | | - Query terminal cell size via CSI 16t (XTWINOPS) instead of hardcoded 8x16 fallback, giving accurate image aspect ratios - Wrap all placement output in synchronized output (DEC mode 2026) to eliminate flicker during scroll and redisplay - Add native dirvish preview dispatcher (kitty-image) that hooks into dirvish-preview-dispatchers for automatic image preview - Improve shr/eww advice to detect actual image type from spec - Extract kitty-gfx--refresh-overlay for cleaner refresh cycle - Reset position cache on buffer/window change so images re-place after d=a - Bump version to 0.2.0, update package metadata and README
* Add dired preview command and improve image-mode integrationcashmere2026-02-241-2/+44
| | | | | | - kitty-gfx-dired-preview: preview images in a side window from dired - image-mode: add q to quit, set buffer-read-only - Add dired-get-file-for-visit forward declaration
* Initial commit: kitty-graphics.elcashmere2026-02-243-0/+821
| | | | | | Display images in terminal Emacs via Kitty graphics protocol with direct placements. Integrates with org-mode (including org-link-preview for org 10.0+), image-mode, and shr/eww.
* initcashmere2026-02-231-0/+0