Skip to content
Myr

Kitty image support improvements

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Use `--unicode-placeholder` for consistent result in and out of tmux * Use updated version of junegunn/go-runewidth that handles diacritics used in Kitty Unicode placeholder Close #3567

authored by Junegunn Choi · committed by Junegunn Choi · parent cdfaf76 · Browse files · 5 files+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+6 added−6 removed

  • other:+6 added−6 removed

5 files+6 added−6 removed

modified:bin/fzf-preview.sh+1 added-1 removed
modified:CHANGELOG.md+1 added-1 removed
122 unmodified lines
123 if file --mime-type {} | grep -qF image/; then124 # --transfer-mode=memory is the fastest option but if you want fzf to be able125 # to redraw the image on terminal resize or on 'change-preview-window',126 # you need to use --transfer-mode=stream.127 kitty icat --clear --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 {} | sed \$d127 kitty icat --clear --transfer-mode=memory --unicode-placeholder --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 {} | sed \$d128 else129 bat --color=always {}130 fi131 '
1720 unmodified lines
modified:go.mod+1 added-1 removed
1module github.com/junegunn/fzf23require (4 github.com/gdamore/tcell/v2 v2.5.45 github.com/junegunn/go-runewidth v0.0.0-20240114080738-1b95d8d53ad85 github.com/junegunn/go-runewidth v0.0.15-0.20240116150947-31c2dd15ab486 github.com/mattn/go-isatty v0.0.177 github.com/mattn/go-shellwords v1.0.128 github.com/rivo/uniseg v0.4.49 github.com/saracen/walker v0.1.3
13 unmodified lines
modified:go.sum+2 added-2 removed
1github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=2github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=3github.com/gdamore/tcell/v2 v2.5.4 h1:TGU4tSjD3sCL788vFNeJnTdzpNKIw1H5dgLnJRQVv/k=4github.com/gdamore/tcell/v2 v2.5.4/go.mod h1:dZgRy5v4iMobMEcWNYBtREnDZAT9DYmfqIkrgEMxLyw=5github.com/junegunn/go-runewidth v0.0.0-20240114080738-1b95d8d53ad8 h1:qcSgFcU7GG0oYYbUzJJvv2AcJRPzjVZLwrL4ZahMpOw=6github.com/junegunn/go-runewidth v0.0.0-20240114080738-1b95d8d53ad8/go.mod h1:Mq6NazeZhIIQPMFoInCi35AktcN/MuW2elHsDK5N52w=5github.com/junegunn/go-runewidth v0.0.15-0.20240116150947-31c2dd15ab48 h1:546WmTZE4BUDJXhKlsaqhgdAPt+yWp82cNkzJxsvVDQ=6github.com/junegunn/go-runewidth v0.0.15-0.20240116150947-31c2dd15ab48/go.mod h1:Mq6NazeZhIIQPMFoInCi35AktcN/MuW2elHsDK5N52w=7github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=8github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=9github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=10github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
42 unmodified lines
modified:README.md+1 added-1 removed
739 unmodified lines
740741```sh742fzf --preview='743 if file --mime-type {} | grep -qF image/; then744 kitty icat --clear --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 {} | sed \$d744 kitty icat --clear --transfer-mode=memory --unicode-placeholder --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 {} | sed \$d745 else746 bat --color=always {}747 fi748'
65 unmodified lines