sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
13.98k stars 318 forks source link

Show mount points #1272

Open Ape opened 1 month ago

Ape commented 1 month ago

Please describe the problem you're trying to solve

I'd like to see if a directory is a mount point.

Would you be willing to contribute this feature?

Describe the solution you'd like

It could look something like this:

bin
boot (vfat on /dev/sdb1)
dev (devtmpfs)
etc
home (btrfs on /dev/sdc1)
lib
lib64
mnt
opt
proc (proc)
root
run (tmpfs)
sbin
srv
sys (sysfs)
tmp (tmpfs)
usr
var

Additional context

No response

sxyazi commented 1 month ago

Does this mean it only works on Unix systems? I'm not sure if Windows has the concept of mount points.

I think it should be implemented as a plugin rather than a builtin feature. Recently, I've been enhancing the API for extending UI components with plugins, https://github.com/sxyazi/yazi/pull/1257. This will make it easier to implement it as a UI plugin & fetcher.

Ape commented 1 month ago

Yeah, I guess this would be Unix only. I'd be happy to have the feature as a plugin.

Ape commented 1 month ago

I made a proof-of-concept plugin for this feature: https://github.com/Ape/mount-points.yazi

However, it is currently quite unusable because of performance implications. The plugin refreshes the mount point information constantly. Ideally it would do it in a task and only when needed.

AnirudhG07 commented 1 month ago

@Ape there's a plugin archivemount.yazi, it can mount archives(as the name suggests) as well tell if a direc is a mountpoint or not. Check if out. If you do not find it satisfactory, we can update the UI part for that plugin, as per requirements suggest. Thanks!

Ape commented 1 month ago

@Ape there's a plugin archivemount.yazi, it can mount archives(as the name suggests) as well tell if a direc is a mountpoint or not. Check if out. If you do not find it satisfactory, we can update the UI part for that plugin, as per requirements suggest. Thanks!

That plugin doesn't seem to currently have the feature I'm looking for. Check mount-points.yazi for reference.