Skip to content

Portrait rendering breaks on multi-monitor, window moves, and DPI changes #50

@arcaven

Description

@arcaven

Observed behavior

Multiple related portrait rendering issues, all stemming from terminal graphics protocol (Kitty/Sixel) interaction with WezTerm multi-monitor handling:

  1. Starting a second forestage on another monitor erases the portrait from the first session
  2. Moving a window between monitors erases the portrait (toggle on/off restores it)
  3. On a different-resolution monitor, the portrait renders as a partial/cropped image
  4. Size cycling in bottom position causes horizontal drift (small=far right, original=near center)

Root cause

  • ratatui-image captures picker.font_size() once at startup
  • Kitty protocol images stored in terminal graphics memory are invalidated by monitor/DPI changes
  • Multiple instances may compete for graphics IDs
  • Cell size calculations use stale font metrics after the display context changes

Fix direction

  • Listen for terminal resize events and re-query font size from the picker
  • Re-send image data after resize/move (force re-render)
  • May need ratatui-image upstream support for resize-aware rendering

Priority

Low — these are edge cases that affect multi-monitor setups. The portrait is cosmetic and can be restored with Ctrl+P or Alt+P toggle. Core TUI functionality (text, input, conversation) is unaffected.

Environment

  • Terminal: WezTerm
  • OS: macOS (multi-monitor, different resolutions)
  • ratatui-image 10.0, crossterm 0.29

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions