Skip to content

feat: enhance --mounts: display mount root path#1463

Open
vlad20012 wants to merge 1 commit into
eza-community:mainfrom
vlad20012:mount-root
Open

feat: enhance --mounts: display mount root path#1463
vlad20012 wants to merge 1 commit into
eza-community:mainfrom
vlad20012:mount-root

Conversation

@vlad20012

@vlad20012 vlad20012 commented Apr 21, 2025

Copy link
Copy Markdown

The path of mount root is now printed in square brackets next to a mount source, similar
to findmnt command output. The root is not displayed if it equals to /.

Example:

mkdir /foo && mkdir /bar;
mount --bind /bar /foo
eza -l --mounts /
# /bar
# /foo [/dev/sda1[/bar] (ext4)]
# ...
findmnt /foo
# /foo /dev/sda1[/bar] ext4   rw,relatime,errors=remount-ro

This is useful for mount --bind as well as for mounts of non-default btrfs subvolumes.
Linux only.

@vlad20012 vlad20012 changed the title Enhance --mounts: display mount root path feat: enhance --mounts: display mount root path Apr 21, 2025
@vlad20012 vlad20012 force-pushed the mount-root branch 2 times, most recently from 2ade1e8 to 2702e78 Compare April 22, 2025 09:14

@cafkafk cafkafk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is pretty cool. One thing I do think would be nice before merge is if the mounts would be aligned on the grid (and respect the --header flag as well). Currently, the mounts are unaligned.

E.g. see:

$ eza -l / --mounts --header --no-permissions --no-user --no-filesize --no-time
Name
bin
boot [/dev/nvme0n1p1 (vfat)]
dev [devtmpfs (devtmpfs)]
etc
home [zpool/home (zfs)]
lib
lib64
mnt
nix [zpool/nix (zfs)]
opt
proc [proc (proc)]
root
run [tmpfs (tmpfs)]
rustup
srv
sys [sysfs (sysfs)]
tmp [tmpfs (tmpfs)]
usr
var [zpool/var (zfs)]

The path of root is printed in square brackets next to a mount source, similar
 to `findmnt` command output. The root is not displayed if it equals to `/`.

Example:
```
mkdir /foo && mkdir /bar;
mount --bind /bar /foo
eza -l --mounts /
# /bar
# /foo [/dev/sda1[/bar] (ext4)]
# ...
findmnt /foo
# /foo /dev/sda1[/bar] ext4   rw,relatime,errors=remount-ro
```

This is useful for `mount --bind` as well as for mounts of non-default btrfs subvolumes.
@vlad20012

vlad20012 commented May 1, 2025

Copy link
Copy Markdown
Author

@cafkafk I agree, indeed it would be much better if mounts are aligned. But I don't add mounts in this PR. They were added in #167, and they was unaligned there. So I believe alignment should be done in a separate PR.

@vlad20012

Copy link
Copy Markdown
Author

@cafkafk Oh wait, after some thought, it began to seem to me that mount are rather similar to symlik destinations. And symlinks destinations seems not aligned in both ls -l and eza.

image

So, do you really think mounts should be aligned regardless?

@gierens gierens left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vlad20012 Code and functionality looks fine to me! Thanks! ... @cafkafk regarding the alignment, I think this would unnecessarily complicate this PR ... I'd rather see this in a separate PR that then might also tackle the missing alignment of symlink targets.

@vlad20012

vlad20012 commented Feb 1, 2026

Copy link
Copy Markdown
Author

@cafkafk,
Hi! Just a friendly ping - would love your thoughts when you have a moment. I’d really appreciate it if we could get this PR merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants