Skip to content

feat: album art in now-playing panel via Kitty/iTerm2 graphics protocol #41

@gitcoder89431

Description

@gitcoder89431

Feature

Render the current track's YouTube thumbnail as inline pixel art in the now-playing panel for terminals that support the Kitty graphics protocol or iTerm2 inline image protocol. Gracefully degrade to nothing (or ASCII block art) on unsupported terminals.

Why

Album art is the #1 most-requested feature across terminal music players (rmpc, kew, termusic all highlight it as a major differentiator). It transforms the now-playing panel from a text readout into something that feels like a real music player. tuitube already fetches YouTube metadata — the thumbnail URL is a free byproduct.

Terminal Support

Protocol Terminals
Kitty graphics protocol Kitty, WezTerm, Ghostty
iTerm2 inline images iTerm2, WezTerm
Sixel mlterm, xterm with sixel, foot
Fallback All others — render nothing / small ASCII block

Detection: check $TERM, $TERM_PROGRAM, and $KITTY_WINDOW_ID at startup.

Implementation sketch

  1. Fetch thumbnail URL from https://i.ytimg.com/vi/{youtube_id}/mqdefault.jpg (160×90, always available)
  2. Resize to ~128×128 using golang.org/x/image or github.com/disintegration/imaging
  3. Encode and write using Kitty protocol escape sequence (\x1b_Ga=T,...\x1b\\) or iTerm2 (\x1b]1337;File=...)
  4. Render in a fixed region of the now-playing panel in Bubble Tea — use a lipgloss box with fixed dimensions so layout doesn't shift when art is absent
  5. Cache the last N thumbnails to disk (~/.cache/tuitube/thumbs/) to avoid re-fetching on skip-back

Files likely affected

  • internal/screens/nowplaying.go or equivalent now-playing view
  • New internal/art/art.go package for protocol detection + rendering

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions