[Bash-completion-devel] [bash-completion-Bugs][313502] [PATCH] Workaround bash bug that fails to complete <, >

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Wed Jan 11 10:15:21 UTC 2012


Bugs item #313502, was opened at 2012-01-11 04:15 by Sung Pae
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=313502&group_id=100114

Status: Open
Priority: 3
Submitted By: Sung Pae (guns-guest)
Assigned to: Nobody (None)
Summary: [PATCH] Workaround bash bug that fails to complete <, > 
Distribution: --Distribution-Agnostic--
Originally reported in: None
Milestone: None
Status: None
Original bug number: 


Initial Comment:
There is a bug in bash that causes completions of some of the
redirection operators to fail if a default completion function is
defined.

The details are in the following bug-bash mailing list message, but put
simply, when completing a command line "> ", bash mistakenly searches
the completions table for an empty string, and failing that, sends
the default completion function not an empty string, but the actual
redirection operator '>' as the first argument.

http://lists.gnu.org/archive/html/bug-bash/2012-01/msg00045.html

This is quite simply worked around for the moment by defining the
_minimal completion for the empty string. This allows filename
completion for people who like to:

    $ > cats.txt        # Truncate files quickly
    $ >> cats.txt       # Use redirection as a quick 'touch'
    $ < cats.txt cat    # Use redirection at the beginning of the
                        # command line

Given the slow bash upgrade cycle for various operating systems, a
workaround for this issue will be necessary for a long time.


----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=313502&group_id=100114



More information about the Bash-completion-devel mailing list