udisksctl: fix paths with a colon

For paths such as `/dev/disk/by-id/usb-JetFlash_Transcend_64GB_15AFGA849642-0:0`, `_describe` parses the colon as field separator. This results in wrong completions and the general feeling that udisksctl is broken because it won't mount my pendrive.

Since the output of `udisksctl complete` is (apparently) just a list of paths, it's safe to escape all colons with a backslash.
This commit is contained in:
Hannu Hartikainen 2021-01-18 10:13:44 +00:00 committed by GitHub
parent 00c7e28e4a
commit 19a412373f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@
_paths() {
local -a _path_list
for _path in $(_call_program paths "udisksctl complete \"udisksctl $words\" $CURSOR"); do
for _path in $(_call_program paths "udisksctl complete \"udisksctl $words\" $CURSOR" | sed 's/:/\\:/g'); do
_path_list+=$_path
done