m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 15:53:39 -05:00

Sixel and Kitty image support on Windows binary (#2544)

This commit is contained in:
Junegunn Choi
2023-11-03 00:07:28 +09:00
parent d0466fa777
commit 68db9cb499
8 changed files with 59 additions and 16 deletions

View File

@@ -98,9 +98,22 @@ 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) PassThrough(y int, x int, data string) {
tty, _ := _screen.Tty()
ti, err := tcell.LookupTerminfo(os.Getenv("TERM"))
if err != nil {
return
}
ti.TPuts(tty, ti.TGoto(x, y))
ti.TPuts(tty, data)
}
func (r *FullscreenRenderer) Sync(hard bool) {
if hard {
_screen.Sync()
} else {
_screen.Show()
}
}
func (r *FullscreenRenderer) Resize(maxHeightFunc func(int) int) {}
@@ -207,10 +220,10 @@ func (r *FullscreenRenderer) Refresh() {
// noop
}
// TODO: Pixel width and height not implemented
func (r *FullscreenRenderer) Size() TermSize {
cols, lines := _screen.Size()
return TermSize{lines, cols, 0, 0}
tty, _ := _screen.Tty()
ws, _ := tty.WindowSize()
return TermSize{ws.Height, ws.Width, ws.PixelWidth, ws.PixelHeight}
}
func (r *FullscreenRenderer) GetChar() Event {