diff --git a/share/functions/__fish_print_mounted.fish b/share/functions/__fish_print_mounted.fish index a5e955c2d..0a454b7f2 100644 --- a/share/functions/__fish_print_mounted.fish +++ b/share/functions/__fish_print_mounted.fish @@ -2,7 +2,11 @@ function __fish_print_mounted --description 'Print mounted devices' if test -r /etc/mtab # In mtab, spaces are replaced by a literal '\040' # So it's safe to get the second "field" and then replace it - sed -e "s/[^ ]\+ \([^ ]\+\) .*/\\1/" -e "s/\\040/ /g" /etc/mtab + # \011 encodes a tab, \012 encodes a newline and \\ encodes a backslash + # This will probably break on newlines because of our splitting, though + # and tabs because of descriptions + string replace -r '\S+ (\S+) .*' '$1'