mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-15 04:54:14 +02:00
Add completion for the kittens
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var Sep = string(os.PathSeparator)
|
||||
@@ -56,6 +58,15 @@ func Abspath(path string) string {
|
||||
|
||||
var config_dir string
|
||||
|
||||
func KittyExe() (string, error) {
|
||||
exe, err := os.Executable()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
ans := filepath.Join(filepath.Dir(exe), "kitty")
|
||||
return ans, unix.Access(ans, unix.X_OK)
|
||||
}
|
||||
|
||||
func ConfigDir() string {
|
||||
if config_dir != "" {
|
||||
return config_dir
|
||||
|
||||
Reference in New Issue
Block a user