kenshaw / fv

A command line font viewer using terminal graphics (Sixel, iTerm, Kitty)
MIT License
7 stars 0 forks source link

Doesn't work with Kitty terminal emulator #1

Closed Disonantemus closed 3 weeks ago

Disonantemus commented 3 weeks ago

Inside Kitty shows: error: term graphics not available.

$ ./fv /usr/share/fonts/cantarell/Cantarell-VF.otf
Usage:
  fv [flags] <font1> [font2, ..., fontN]

Flags:
      --all                    show all system fonts
      --bg color               background color (default white)
      --dpi int                dpi (default 100)
      --fg color               foreground color (default black)
  -h, --help                   help for fv
      --list                   list system fonts
      --margin int             margin (default 5)
      --match                  match system fonts
      --size int               font size (default 48)
      --style font-style       font style (default regular)
      --text string            display text
      --variant font-variant   font variant (default normal)
  -v, --version                version for fv

error: term graphics not available

System:

distro: Arch Linux x86_64 
kernel: 6.6.22-1-lts 
shell: bash 5.2.32 
cpu: Intel i7-4790 (8) @ 3.600GHz 
gpu: AMD ATI Radeon RX 470/480/570/570X/580/580X/590
kenshaw commented 3 weeks ago

@Disonantemus you can try export TERM_GRAPHICS=kitty -- let me know if that works for you. What OS / version of Kitty are you using? It works "out of the box" with the Kitty I have installed (also on Arch).

Disonantemus commented 3 weeks ago

export TERM_GRAPHICS=kitty


$ pacman -Si kitty | head -3
Repository      : extra
Name            : kitty
Version         : 0.35.2-1

Updated version from official extra arch repo.

kenshaw commented 3 weeks ago

Unfortunately, there is no automatic detection of kitty at the moment, and you likely are overwriting the TERM variable for use with other applications. That's the reason for the rasterm library supporting TERM_GRAPHICS. I just checked, and the default TERM variable for kitty is TERM=xterm-kitty, which the rasterm library (and thus fv) will properly detect. Please use the TERM_GRAPHICS environment variable. I am looking into doing better automated support of detecting kitty and wezterm terminals, but there is no realistic ETA on when that might be available. I'm closing this issue for now, as this is working "as designed" currently.