fzf/src
Junegunn Choi d8188fce7b
Experimental support for Kitty image protocol in preview window
Close #3228

* Works inside and outside of tmux
* There is a problem where fzf unnecessarily displays the scroll offset
  indicator at the topbright of the screen when the image just fits the
  preview window. This is because `kitty icat` generates an extra line
  after the image area.

    # A 5-row images; an extra row at the end confuses fzf
    ["\e_Ga ... \e[9C􎻮̅̅ࠪ􎻮̅̍ࠪ􎻮̅̎ࠪ􎻮̅̐ࠪ􎻮̅̒ࠪ􎻮̅̽ࠪ􎻮̅̾ࠪ􎻮̅̿ࠪ􎻮̅͆ࠪ􎻮̅͊ࠪ􎻮̅͋ࠪ\n",
     "\r\e[9C􎻮̍̅ࠪ􎻮̍̍ࠪ􎻮̍̎ࠪ􎻮̍̐ࠪ􎻮̍̒ࠪ􎻮̍̽ࠪ􎻮̍̾ࠪ􎻮̍̿ࠪ􎻮̍͆ࠪ􎻮̍͊ࠪ􎻮̍͋ࠪ\n",
     "\r\e[9C􎻮̎̅ࠪ􎻮̎̍ࠪ􎻮̎̎ࠪ􎻮̎̐ࠪ􎻮̎̒ࠪ􎻮̎̽ࠪ􎻮̎̾ࠪ􎻮̎̿ࠪ􎻮̎͆ࠪ􎻮̎͊ࠪ􎻮̎͋ࠪ\n",
     "\r\e[9C􎻮̐̅ࠪ􎻮̐̍ࠪ􎻮̐̎ࠪ􎻮̐̐ࠪ􎻮̐̒ࠪ􎻮̐̽ࠪ􎻮̐̾ࠪ􎻮̐̿ࠪ􎻮̐͆ࠪ􎻮̐͊ࠪ􎻮̐͋ࠪ\n",
     "\r\e[9C􎻮̒̅ࠪ􎻮̒̍ࠪ􎻮̒̎ࠪ􎻮̒̐ࠪ􎻮̒̒ࠪ􎻮̒̽ࠪ􎻮̒̾ࠪ􎻮̒̿ࠪ􎻮̒͆ࠪ􎻮̒͊ࠪ􎻮̒͋ࠪ\n",
     "\r\e[39m\e8"]

* Example:

  fzf --preview='
    if file --mime-type {} | grep -qF 'image/'; then
      # --transfer-mode=memory is the fastest option but if you want fzf to be able
      # to redraw the image on terminal resize or on 'change-preview-window',
      # you need to use --transfer-mode=stream.
      kitty icat --clear --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 {}
    else
      bat --color=always {}
    fi
  '
2023-10-07 18:36:33 +09:00
..
algo Use strings.ContainsRune instead (#3335) 2023-06-17 19:10:12 +09:00
protector Modernize build tags 2022-03-29 21:23:45 +09:00
tui Experimental support for Kitty image protocol in preview window 2023-10-07 18:36:33 +09:00
util Fix center-alignment of border/preview label 2023-09-01 20:30:44 +09:00
ansi_test.go Update ANSI test cases 2022-08-13 22:40:37 +09:00
ansi.go Respect ANSI codes to reset properties 2023-09-16 19:50:37 +09:00
cache_test.go Check gofmt in make test 2021-02-28 18:28:21 +09:00
cache.go Consolidate Result and rank structs 2017-07-18 03:14:33 +09:00
chunklist_test.go Remove count field from ChunkList 2017-08-16 12:26:06 +09:00
chunklist.go Experimental implementation of "reload" action 2019-11-10 11:43:37 +09:00
constants.go Remove unnecessary escaping in the default command 2023-09-24 13:23:40 +09:00
core.go Fix bug where preview is not updated after reload when --disabled is set 2023-05-27 15:51:04 +09:00
history_test.go Fix deprecations of ioutil (#3370) 2023-07-16 17:14:22 +09:00
history.go Fix deprecations of ioutil (#3370) 2023-07-16 17:14:22 +09:00
item_test.go Micro-optimizations 2016-08-19 02:39:32 +09:00
item.go Remove special nilItem 2017-08-15 01:10:41 +09:00
LICENSE 0.36.0 2023-01-17 01:33:05 +09:00
matcher.go Fix bug where preview is not updated after reload when --disabled is set 2023-05-27 15:51:04 +09:00
merger_test.go Update test case 2023-05-27 16:01:30 +09:00
merger.go Fix bug where preview is not updated after reload when --disabled is set 2023-05-27 15:51:04 +09:00
options_test.go Fix deprecations of ioutil (#3370) 2023-07-16 17:14:22 +09:00
options.go Add toggle-header option 2023-07-25 22:11:15 +09:00
pattern_test.go Fix incorrect ordering of --tiebreak=chunk 2022-08-03 22:18:26 +09:00
pattern.go Fix incorrect ordering of --tiebreak=chunk 2022-08-03 22:18:26 +09:00
reader_test.go Change the tests to run on Windows (#2615) 2021-09-24 09:45:06 +09:00
reader.go Use $SHELL instead of bash if it's known to support 'pipefail' 2023-07-12 13:55:59 +09:00
result_others.go Modernize build tags 2022-03-29 21:23:45 +09:00
result_test.go Add new tiebreak: 'chunk' 2022-08-02 21:48:19 +09:00
result_x86.go Modernize build tags 2022-03-29 21:23:45 +09:00
result.go Fix panic on inverse match query with --tiebreak=chunk 2022-11-18 20:16:43 +09:00
server.go Add support for limit and offset parameters for GET / endpoint 2023-09-18 00:55:20 +09:00
terminal_test.go Reformat comments adhere to gofmt 2022-08-12 22:11:15 +09:00
terminal_unix.go Modernize build tags 2022-03-29 21:23:45 +09:00
terminal_windows.go Modernize build tags 2022-03-29 21:23:45 +09:00
terminal.go Experimental support for Kitty image protocol in preview window 2023-10-07 18:36:33 +09:00
tokenizer_test.go Code cleanup: remove unnecessary string conversions (#1642) 2019-07-19 13:23:18 +09:00
tokenizer.go Fix delimiter regex to properly support caret (^) 2022-07-21 21:21:06 +09:00