Skip to main content

create_image_picker

Function create_image_picker 

Source
pub fn create_image_picker() -> Option<Picker>
Expand description

Create an image picker for protocol detection

This should be called BEFORE entering alternate screen mode.

Detection priority:

  1. FILEVIEW_IMAGE_PROTOCOL environment variable (explicit override)
  2. Terminal brand detection → recommended protocol
  3. Query terminal capabilities via escape sequences
  4. Chafa → Halfblocks fallback (Chafa requires chafa feature)

Set environment variable FILEVIEW_IMAGE_PROTOCOL to control behavior:

  • auto (default): Auto-detect terminal protocol
  • halfblocks: Force halfblock rendering (most compatible)
  • chafa: Force Chafa rendering (requires chafa feature and libchafa)
  • sixel, kitty, iterm2: Force specific protocol