summaryrefslogtreecommitdiff
path: root/src/tui/tcell.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2023-10-07 18:20:27 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2023-10-07 18:36:33 +0900
commitd8188fce7b7bea982e7f9050c35e488e49fb8fd0 (patch)
tree5391297645ff3d5d19b4dba6885b92a388e21633 /src/tui/tcell.go
parent0f15f1ab73826b615caf395473160efc355143cb (diff)
downloadfzf-d8188fce7b7bea982e7f9050c35e488e49fb8fd0.tar.gz
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 '
Diffstat (limited to 'src/tui/tcell.go')
-rw-r--r--src/tui/tcell.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tui/tcell.go b/src/tui/tcell.go
index 8f6806d4..0c3d4694 100644
--- a/src/tui/tcell.go
+++ b/src/tui/tcell.go
@@ -98,6 +98,11 @@ const (
AttrClear = Attr(1 << 8)
)
+func (r *FullscreenRenderer) PassThrough(str string) {
+ // No-op
+ // https://github.com/gdamore/tcell/issues/363#issuecomment-680665073
+}
+
func (r *FullscreenRenderer) Resize(maxHeightFunc func(int) int) {}
func (r *FullscreenRenderer) defaultTheme() *ColorTheme {