fix: handle empty argument for select (#2429)

* fix: handle empty argument for `select`

* Update `CHANGELOG.md`
This commit is contained in:
Joe Lim authored and GitHub committed 2026-03-11 15:19:03 +11:00
1 parent 23ea7abd51
commit 402c7dd306
2 files changed
+4 -2

No files matched your search

+1
View File
@@ -35,6 +35,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- A bug where the `loading...` message was not displayed for volatile previews after the first time is now fixed (#2410).
- The `cmd-transpose` command now advances the cursor correctly after swapping characters (#2413).
- Symbolic links are no longer followed when changing directories (#2423).
- Using the `select` command with a blank string as the argument now properly raises an error instead of changing to the parent directory (#2429).
## [r41](https://github.com/gokcehan/lf/releases/tag/r41)
+3 -2
View File
@@ -1516,13 +1516,14 @@ func (e *callExpr) eval(app *app, _ []string) {
return
}
path, err := filepath.Abs(replaceTilde(e.args[0]))
path := replaceTilde(e.args[0])
lstat, err := os.Lstat(path)
if err != nil {
app.ui.echoerrf("select: %s", err)
return
}
lstat, err := os.Lstat(path)
path, err = filepath.Abs(replaceTilde(e.args[0]))
if err != nil {
app.ui.echoerrf("select: %s", err)
return