kitten @: Fix relative paths for --password-file being resolved relative to CWD instead of the kitty config directory

This commit is contained in:
Kovid Goyal
2026-01-25 20:30:11 +05:30
parent dadd2b88de
commit 10273d5aa2
2 changed files with 7 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"reflect"
"strconv"
"strings"
@@ -339,6 +340,9 @@ func get_password(password string, password_file string, password_env string, us
}
} else {
var q []byte
if !filepath.IsAbs(password_file) {
password_file = filepath.Join(utils.ConfigDir(), password_file)
}
q, err = os.ReadFile(password_file)
if err == nil {
ans.is_set, ans.val = true, strings.TrimRight(string(q), " \n\t")