Lf: command `select' fails when given broken links

Created on 17 Jul 2019  路  3Comments  路  Source: gokcehan/lf

I noticed that if you have a broken symlink, select fails when it tries to focus the file selector on it with the following error:

select: stat broken: no such file or directory

broken is the file name.

I've encountered this issue when I used a customized mapping for / I wrote to improve the file search experience using fzf and ZSH:

map / $lf -remote "send $id select '$(all_files=(./*(ND)); printf '%s\n' ${all_files[@]} | fzf)'"
bug

All 3 comments

Just had the same issue when I opened a directory full of orphaned symlinks and wanted to use LF to delete some of them. The same message appears when renaming a broken symlink (fortunately it does get renamed afterwards).

I have went through our stat calls and converted some of them to lstat calls so now:

  • select should work with broken links
  • toggled broken links are not removed during load
  • copy does not overwrite broken links

Hopefully, I haven't broken anything in the meantime. Closing this issue now.

Confirmed that select should work with broken links. Thanks again!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aidam38 picture aidam38  路  9Comments

ipstone picture ipstone  路  6Comments

itmitica picture itmitica  路  6Comments

mvrozanti picture mvrozanti  路  6Comments

juacq97 picture juacq97  路  6Comments