mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 14:46:03 +00:00
fix: robustly handle non-existent initial directory in choose-files kitten
This commit is contained in:
parent
7b3cbc1de3
commit
38952e490d
1 changed files with 5 additions and 1 deletions
|
|
@ -983,7 +983,11 @@ func main(_ *cli.Command, opts *Options, args []string) (rc int, err error) {
|
|||
return
|
||||
}
|
||||
if st, serr := os.Stat(default_cwd); serr != nil || !st.IsDir() {
|
||||
default_cwd = utils.Expanduser("~")
|
||||
if home := utils.Expanduser("~"); home != "~" {
|
||||
default_cwd = home
|
||||
} else {
|
||||
default_cwd = "/"
|
||||
}
|
||||
}
|
||||
|
||||
lp.OnInitialize = func() (string, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue