Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 610106 - sys-apps/util-linux: umount bash completion breaks when 'mount' is aliased
Summary: sys-apps/util-linux: umount bash completion breaks when 'mount' is aliased
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
Depends on:
Reported: 2017-02-20 17:58 UTC by Alex Efros
Modified: 2021-01-12 14:09 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Alex Efros 2017-02-20 17:58:39 UTC
Previous sys-apps/util-linux-2.26.2 doesn't have this issue because it doesn't provide /usr/share/bash-completion/completions/umount.

I've this alias in bash to show colorful output of `mount`:

  alias mount='grc mount'

and now when I use TAB to complete `umount /mnt/w<TAB>` I get ANSI escape sequence junk at end of umount:

  # mount /mnt/webdav.mailru/
  # umount /mnt/webdav.mailru^[[0m 

This happens because this line in /usr/share/bash-completion/completions/umount executes `grc mount` instead of /bin/mount:

  DEVS_MPOINTS="$(mount | awk '{print $1, $3}')"

I propose to change this line to one of:

  DEVS_MPOINTS="$(/bin/mount | awk '{print $1, $3}')"
  DEVS_MPOINTS="$(command mount | awk '{print $1, $3}')"

Latest ~arch util-linux-2.29.1-r1 also have same issue.
Comment 1 SpanKY gentoo-dev 2017-02-22 16:41:20 UTC
i don't know what the bash completion practices are in scenarios like this.  sounds like this is a generic problem with completions that users can break the env by redefining standard things.