fix: handle non-existent initial directory in choose-files kitten (issue #10292)

This commit is contained in:
copilot-swe-agent[bot] 2026-07-28 03:00:03 +00:00 committed by GitHub
parent 7ed3477d5c
commit 7b3cbc1de3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -982,6 +982,9 @@ func main(_ *cli.Command, opts *Options, args []string) (rc int, err error) {
if default_cwd, err = filepath.Abs(default_cwd); err != nil {
return
}
if st, serr := os.Stat(default_cwd); serr != nil || !st.IsDir() {
default_cwd = utils.Expanduser("~")
}
lp.OnInitialize = func() (string, error) {
if opts.WritePidTo != "" {