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
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 0 deletions

View file

@ -202,6 +202,9 @@ Detailed list of changes
- icat kitten: When catting multiple images display the images in input order (:iss:`9413`)
- kitten @: Fix relative paths for --password-file being resolved relative to
CWD instead of the kitty config directory
0.45.0 [2025-12-24]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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")