Skip to content

Add drives to windows #3240

@Universal-Invariant

Description

@Universal-Invariant

yazi --debug output

https://github.com/sxyazi/yazi/issues/2998

Please describe the problem you're trying to solve

In windows we really need an easy way to navigate drives.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

The solution is simple:

When one navigates to a root drive then a special mode is entered where one can go up one more ancestor which could be called "Drives" or "This PC" or whatever. From there, the "files panel" shows the drives list. Then one can navigate from them to change drives.

An alternative is that when one hits the left arrow in a drive a dialog pops up listing the drives which one can navigate with the "up/down keys" and then hitting enter or right arrow on a drive then goes to that drive.

One could then also add other things, say, such as network drives, mount points, bookmarks, etc in the config and they will be listed too.

The idea is that we can navigate to a root that contains all the drives rather than just a drive as a root. This can be done anyway that works as long as it is effectively transparent. E.g., the way I envision it is that while at the root of the C drive the left panel shows C:\ with no entries. I then hit left and it shows "This PC" and in the middle pane a list of all the drives. I then can navigate to the drive I want and hit right and then carry on as usual.

It may be possible to emulate this behavior by having a special directory called "ThisPC" which contains symlinks to the drives(and an other things one wants) and hitting left from such a root drive automatically goes to this folder. This might be the cleanest way to handle it but it might not be perfect because one likely could backtrack further. So maybe that needs to be cut off so one can't navigate out of it.

This latter solution would also work on other platforms without issue and likely is just a few lines of code.

I would implement it but I know nothing about the internals of yazi and I'd need to know how to easily debug it. I have rust installed so I might be able to do it but I don't have time at the moment and perusing the docs doesn't seem to give enough info about the internals.

Additional context

No response

Checklist

  • I have searched the existing issues/discussions
  • The latest nightly build doesn't already have this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions