coldfix / udiskie

Automounter for removable media
MIT License
866 stars 53 forks source link

shell completions: need to escape spaces in labels #253

Closed rsekman closed 10 months ago

rsekman commented 1 year ago

Steps to reproduce

Mount a disk with a label that contains spaces, e.g. "My Disk". In zsh, start typing

% udiskie-umount M<tab>

which completes to

% udiskie-umount My Disk

If run this predictably fails:

failed to remove My: no device found owning "My"
failed to remove Disk: no device found owning "Disk"

while

% udiskie-umount "My Disk"
% udiskie-umount My\ Disk

would both work.

Version information

% udiskie --version
udiskie 2.4.2
% zsh --version
zsh 5.9 (x86_64-pc-linux-gnu)
% uname -a
Linux naoetsu 6.0.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 10 Nov 2022 21:14:24 +0000 x86_64 GNU/Linux
coldfix commented 1 year ago

Thanks! Good point, I'll have a look.

coldfix commented 1 year ago

Quick update: It seems to be a problem with the _canonical_paths function that I now reported to zsh-mailing list https://www.zsh.org/mla/workers/2022/msg01326.html.

Even if this is fixed, it will probably take years until the fix is available in all user machines, so I'll look into an alternative (simpler) implementation without using this function.