<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>98627</bug_id>
          
          <creation_ts>2005-07-10 23:02 0000</creation_ts>
          <short_desc>bash-completion cannot complete `mount xyz` properly</short_desc>
          <delta_ts>2007-06-02 05:30:40 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>trivial</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>korngerd@yahoo.com</reporter>
          <assigned_to>shell-tools@gentoo.org</assigned_to>
          <cc>kenyon@kenyonralph.com</cc>

      

      
          <long_desc isprivate="0">
            <who>korngerd@yahoo.com</who>
            <bug_when>2005-07-10 23:02:44 0000</bug_when>
            <thetext>Anytime you have a grep alias set to &quot;grep --color=always&quot;, bash-completion
fails to complete `mount` commands properly.  It uses the aliased grep to spit
out the possible mount locations.  Line 655 of /etc/bash_completion should have:
  /etc/fstab | grep --color=never &quot;^$cur&quot; ) )
along with any other &quot;grep&quot; instances.

Reproducible: Always
Steps to Reproduce:
1. alias &quot;grep=grep --color=always&quot;
2. mount / [tab]
Actual Results:  
^[\[01\;31m/^[\[00m gets spit out

Expected Results:  
/ should get spit out (along with any other possible mounts under /).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ka0ttic@gentoo.org</who>
            <bug_when>2005-07-13 05:03:30 0000</bug_when>
            <thetext>Using --color=never is not a viable solution.  What if grep is not GNU grep?

I&apos;m thinking more of closing this WONTFIX and updating the ebuild&apos;s pkg_postinst
instructions to state that /etc/profile.d/bash-completion should be sourced
*before* you declare anything else in ~/.bashrc, as there&apos;s no guarantee that
any aliases you set wont be a) misused unintentionally as in this case, or b)
re-set to something else by bash-completion (it does set some aliases under
certain conditions).

I am willing to listen to any alternative solutions you may have, however.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>korngerd@yahoo.com</who>
            <bug_when>2005-07-13 12:43:56 0000</bug_when>
            <thetext>(In reply to comment #1)
&gt; I&apos;m thinking more of closing this WONTFIX and updating the ebuild&apos;s pkg_postinst
&gt; instructions to state that /etc/profile.d/bash-completion should be sourced
&gt; *before* you declare anything else in ~/.bashrc, as there&apos;s no guarantee that
&gt; any aliases you set wont be a) misused unintentionally as in this case, or b)
&gt; re-set to something else by bash-completion (it does set some aliases under
&gt; certain conditions).

Actually, that might be a better solution to this :)  A warning at the end would
solve any other alias issues as well.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ka0ttic@gentoo.org</who>
            <bug_when>2005-07-14 00:34:47 0000</bug_when>
            <thetext>I&apos;ve updated the pkg_postinst of existing ebuilds, and made note of this bug,
giving instructions that any aliases set should be done after sourcing
/etc/profile.d/bash-completion.

Might as well mark this FIXED, since that&apos;s the reasonable resolution.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kenyon@kenyonralph.com</who>
            <bug_when>2005-07-20 10:40:31 0000</bug_when>
            <thetext>Just setting aliases after sourcing /etc/profile.d/bash-completion doesn&apos;t mean
the alias will work.  I can&apos;t get an alias of rm=&apos;rm -iv&apos; when bash-completion
has been sourced.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kenyon@kenyonralph.com</who>
            <bug_when>2005-07-20 11:12:16 0000</bug_when>
            <thetext>(In reply to comment #4)
&gt; Just setting aliases after sourcing /etc/profile.d/bash-completion doesn&apos;t mean
&gt; the alias will work.  I can&apos;t get an alias of rm=&apos;rm -iv&apos; when bash-completion
&gt; has been sourced.

Nevermind, I&apos;m experiencing Bug 99540.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>nilton@ic.unicamp.br</who>
            <bug_when>2007-06-02 05:30:40 0000</bug_when>
            <thetext>Another solution or this would be to prefix grep with the bash &quot;command&quot; builtin, so that any aliases are ignored. This would always work, and one would not need to worry about the order of defining aliases.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>