How to make fzf work with kitty text protocol? #4478
Unanswered
5hubham5ingh
asked this question in
Q&A
Replies: 1 comment
-
Seems unimplemented now: a hack to treat it as image: diff --git a/src/terminal.go b/src/terminal.go
index 0fd5d006..c879693a 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -82,9 +82,10 @@ func init() {
\x1bPtmux;\x1b\x1b .*? [^\x1b]\x1b\\
| \x1b(_G|P[0-9;]*q) .*? \x1b\\\r?
| \x1b]1337; .*? (\a|\x1b\\)
+ | \x1b]66; .*? (\a)
`)
*/
- passThroughBeginRegex = regexp.MustCompile(`\x1bPtmux;\x1b\x1b|\x1b(_G|P[0-9;]*q)|\x1b]1337;`)
+ passThroughBeginRegex = regexp.MustCompile(`\x1bPtmux;\x1b\x1b|\x1b(_G|P[0-9;]*q)|\x1b]1337;|\x1b]66;`)
passThroughEndTmuxRegex = regexp.MustCompile(`[^\x1b]\x1b\\`)
}
@@ -3769,6 +3770,19 @@ func findPassThrough(line string) []int {
}
index += pos + 1
}
+ } else if strings.HasPrefix(rest, "\x1b]66;") {
+ index := loc[1]
+ for {
+ after := line[index:]
+ pos := strings.IndexAny(after, "\x1b\a")
+ if pos < 0 {
+ return nil
+ }
+ if after[pos] == '\a' {
+ return []int{loc[0], index + pos + 1}
+ }
+ index += pos + 1
+ }
}
// Kitty
pos := strings.Index(after, "\x1b\\")
@@ -3836,7 +3850,8 @@ Loop:
requiredLines := 0
isSixel := strings.HasPrefix(passThrough, "\x1bP")
isItermImage := strings.HasPrefix(passThrough, "\x1b]1337;")
- isImage := isSixel || isItermImage
+ isText := strings.HasPrefix(passThrough, "\x1b]66;")
+ isImage := isSixel || isItermImage || isText
if isImage {
t.previewed.wipe = true
// NOTE: We don't have a good way to get the height of an iTerm image, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have tried with these and none of them are working-
Beta Was this translation helpful? Give feedback.
All reactions