Comments (9)
This is probably related to #1426. Unlike newly created files/directories, extracted files/directories typically retain their original mtime
from the archive, which undermines the reloading mechanism (checking for updated mtime
values) in lf
.
But I found a way to work around this using the watch
option, by invalidating cache entries from remove/rename updates. Can you try #1756 to see if it works?
from lf.
Now the preview will always show the directory as empty instead.
- extract A.zip containing the directory A with 10 files inside.
- delete 5 of files inside A
- delete A
- extract A.zip again
- lf will show the directory A as empty even though there are 10 files inside and the previous version still had 5 files.
The dircounts shows the correct number of files in the new directory though.
from lf.
Oh I fixed a bug just now in 7292788, but I think you commented before I pushed it. Can you try again?
from lf.
Still the same issue. The newly extracted directory is shown as empty
from lf.
It was working for me, but I think there's maybe one or two times where the recreated directory doesn't load for some reason and shows up as failed. I guess maybe it's not consistent, but I can't figure out why though.
from lf.
I tested this again on a fresh install and for me the bug is always present.
Given a default lfrc file, the bug would not appear at all since there is no automatic file refresh, so the question may be related to how the directory is updated.
There are three possible ways to trigger the bug that I found so far:
- Use an extract* command that will make the newly created directory appear (with the outdated info)
- use the period option
- use the watch option
*Command I tested this with is as follows:
cmd extract ${{
set -f
atool -x $f
}}
map a extract
@joelim-work
Can you reproduce the bug with your default config and the mainline branch? If so, can you share your lfrc?
from lf.
It's not a problem with updating the directory contents, it's a problem with stale entries in the directory cache. An entry will only be replaced if the corresponding directory has a later mtime
than its own, and this won't be the case for directories extracted from archives. This means that the original load
and period
mechanisms aren't useful here. But for watch
updates, cache entries can be invalidated when a remove/rename notification is received.
Anyway I ended up merging that PR after a couple more changes - it's probably a good idea to disable the load
command when watch
is enabled, as they are essentially competing mechanisms and seem to cause weird issues when enabled together. So now this is working for me, and I can see the updated file list when re-extracting directories.
from lf.
This fixed the issue for when the watch option is used. Thank you.
Extracting an archive will still show the outdated directory with the default lf options, though there is also no default extract command either.
One workaround I found is to modify the extract command like this:
cmd extract ${{
set -f
atool -x $f
}}
map a : extract; reload
That could be added to the wiki in order to help users without automated file refresh avoid the issue as well.
from lf.
The "default lf
options" you're referring to just simply uses the load
command I mentioned earlier. It's an internal command sent after various operations (e.g. delete
, paste
) to update the files (subject to mtime
values being increased).
So the trick of adding reload
at the end of such commands technically works, and in fact it's already been suggested in various issues before so it's nothing new. But it's also kind of a hacky workaround and I'm not sure I want to recommend such a solution in the wiki. Maybe the answer is to just encourage more users to use watch
instead.
Anyway I will close this issue since it's solved now. Thanks for reporting it.
from lf.
Related Issues (20)
- Yank path w/filename, filename, and file (As in Ranger) in Powershell HOT 6
- [QUESTION] Paste with overwrite for multiple files HOT 5
- Main Column Line Numbers Only HOT 8
- directories have another font type HOT 2
- Feature request: highlighting of cursors when inactive HOT 3
- Feature request: add an lfrc switch to move duplicate copy suffixes at the beginning of filename. HOT 4
- `autoquit` should be enabled by default HOT 6
- how to use fribidi within lf.
- sixel preview writes out of bounds HOT 1
- Broken characters of dir when I use `-print-last-dir` option / change drive option `/d` in `lfcd.cmd` HOT 3
- Issue with scrolling using alt key HOT 6
- Feature request: precalculate previews for files around the cursor HOT 3
- lf does not open terminal text editor when going right HOT 4
- Multishell/Crossplatform handling of `--` HOT 3
- how to use `lf -remote` in cmd? HOT 3
- Downdir command? HOT 2
- Is there a way to select a directory for --print-selection and --selection-path? HOT 3
- Is it possible decide weather to the working dir AFTER enter `lf`? HOT 2
- Resizing terminal font doesn't adjust the size and position of preview image HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lf.