Skip to content

(u)mount: broken on BSD (incl. MacOS) #3094

@diktomat

Description

@diktomat

Current Behavior

  1. Completing mount and umount uses lsblk and /proc/mounts to find devices. Both ways are Linux only and fail on BSDs, including MacOS as BSD-derived OS.
  2. Completing mount and umount presents completions for LABEL=, ID= etc, which are also Linux only.

Expected Behavior

Another way to find mounted devices (maybe just plain mount?) and devices to mount (diskutil list -plist?) is used, wrong completions are removed.

Steps To Reproduce

  1. On BSD/Darwin
  2. Type umount <tab>
  3. The following will be displayed (annotated):
~ > umount <tab>
# all local directories, regardless of them being (parent to) a mount point or not
Applications/
[...]
# errors
ERR  (lsblk resolves to executable in current directory (./lsblk))
ERR1                (open /proc/mounts: no such file or directory)
# wrong completions
ID=                         (specifies device by udev hardware ID)
LABEL=                      (specifies device by filesystem label)
PARTLABEL=                   (specifies device by partition label)
PARTUUID=                     (specifies device by partition UUID)
UUID=                        (specifies device by filesystem UUID)

Version

carapace-bin 1.5.4

OS

  • Darwin
  • Linux
  • Termux
  • Windows

Shell

  • Bash
  • Elvish
  • Fish
  • Nushell
  • Oil
  • Powershell
  • Xonsh
  • Zsh

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdarwinfundFundable with polar.sh

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions