-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yazi uses term 'ctime' incorrectly #1760
Comments
Please try #1761 |
That was quick, thanks for the comprehensive fix! It seems to work fine, the only comment I have is that it would be nice to have a default linemode and sorting shortcut key for the new ctime. |
Could you describe your workflow? When would you need to sort files by Also, would it be possible or necessary to merge |
Just recently I had a case where I had renamed some files (changing the ctime), but I wanted to know when I last edited them (the mtime), which was longer ago. So it's definitely useful to be able to have access to both as linemodes. When it comes to sorting specifically I don't know of a particular usecase off the top of my head, I just think it would be a bit odd to have only partial support for sorting timestamps. But as long as the underlying support is there so that it's possible to define your own sorting shortcut for each timestamp it's not really a big deal, and maybe a combined sorting option would be a good default thing to have. |
My concern is that if we don't combine them, sorting by Would you like to file a new issue for this? We can continue the discussion there to prevent it from getting lost. |
I'm not sure there's a specific thing to create an issue for — I'm happy with the current underlying support for the separate modification times, the default keyboard shortcuts were just a suggestion. Or did you mean an issue about a combined shortcut? In that case you probably know better how you would want it to behave. |
I'm going to lock this issue because it has been closed for 30 days. ⏳ |
What system are you running Yazi on?
Linux X11
What terminal are you running Yazi in?
Kitty 0.36.1
yazi --debug
outputDid you try the latest nightly build to see if the problem got fixed?
No, and I'll explain why below
Describe the bug
There are various places where Yazi uses the term "ctime" for a timestamp associated with a file, for example in linemodes or when sorting files. However, Yazi incorrectly uses the term to refer a file's "creation time", when the term generally refers to a file's (metadata) change time, that is when the inode changes. The creation time is called names like "btime" or "birthtime".
This is also mentioned in Rust's
std::fs::Metadata
documentation, which Yazi uses here:https://doc.rust-lang.org/std/fs/struct.Metadata.html#method.created
This is from Linux's
statx(2)
man page:Also, from
ls(1)
:Minimal reproducer
Attempt to show a file's changed time in Yazi and be surprised at the unexpected timestamp
Anything else?
Both the btime and the ctime are useful, so I would suggest changing the code to (internally) use the properly named btime everywhere Yazi explicitly talks about "created time" and add a field
btime
where it currently usesctime
(like linemodes), and then use the actual ctime for thectime
mentions and add a "changed time" reference in places like file metadata.The text was updated successfully, but these errors were encountered: