chore: import official kitty sources from upstream
Bring the kovidgoyal/kitty codebase in as the base of FWS-Kitty, vendored at upstream commit 91fb38a without its git history.
This commit is contained in:
commit
7e7d249099
1134 files changed
+433629
No files matched your search
@@ -0,0 +1,29 @@
|
||||
// License: GPLv3 Copyright: 2023, Kovid Goyal, <kovid at kovidgoyal.net>
|
||||
|
||||
package tui
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/emmansun/base64"
|
||||
|
||||
"github.com/kovidgoyal/kitty/tools/utils"
|
||||
)
|
||||
|
||||
var _ = fmt.Print
|
||||
|
||||
func DCSToKitty(msgtype, payload string) (string, error) {
|
||||
data := base64.StdEncoding.EncodeToString(utils.UnsafeStringToBytes(payload))
|
||||
ans := "\x1bP@kitty-" + msgtype + "|" + data
|
||||
tmux := TmuxSocketAddress()
|
||||
if tmux != "" {
|
||||
err := TmuxAllowPassthrough()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
ans = "\033Ptmux;\033" + ans + "\033\033\\\033\\"
|
||||
} else {
|
||||
ans += "\033\\"
|
||||
}
|
||||
return ans, nil
|
||||
}
|
||||
Reference in new issue
Block a user