mirror of
https://github.com/junegunn/fzf.git
synced 2025-09-02 13:23:49 -07:00
Experimental Sixel support (#2544)
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"github.com/junegunn/fzf/src/util"
|
||||
"golang.org/x/term"
|
||||
@@ -108,3 +109,19 @@ func (r *LightRenderer) getch(nonblock bool) (int, bool) {
|
||||
}
|
||||
return int(b[0]), true
|
||||
}
|
||||
|
||||
type window struct {
|
||||
lines uint16
|
||||
columns uint16
|
||||
width uint16
|
||||
height uint16
|
||||
}
|
||||
|
||||
func (r *LightRenderer) Size() (termSize, error) {
|
||||
w := new(window)
|
||||
_, _, err := syscall.Syscall(syscall.SYS_IOCTL, r.ttyin.Fd(), syscall.TIOCGWINSZ, uintptr(unsafe.Pointer(w)))
|
||||
if err != 0 {
|
||||
return termSize{}, err
|
||||
}
|
||||
return termSize{int(w.lines), int(w.columns), int(w.width), int(w.height)}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user