git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: bash 4.0 breaks some completion scripts

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 2, 2010, 23:38 UTC
Message-ID
<20101202233848.GA8438@burratino>
In-Reply-To
<20101027235919.GB30490@burratino>
Jonathan Nieder wrote:
> Bash 4.0 changed the rules for completion word splitting so that
> they are incompatible with 3.x.  I think some Breaks: will be needed
> to ensure smooth upgrades.
Just FYI: Ah, at last some clarity!
>From the bash 3 manual:
 COMP_WORDS
	An array variable (see Arrays below) consisting of the
	individual words in the current command line.  The
	words are split on shell metacharacters as the shell
	parser would separate them.  This variable is
	available only in shell functions invoked by the
	programmable completion facilities (see Programmable
	Completion below).
>From the bash 4 manual:
 COMP_WORDS
	An array variable (see Arrays below) consisting of the
	individual words in the current command line.  The
	line is split into words as readline would split it,
	using COMP_WORDBREAKS as described above.  This
	variable is available only in shell functions invoked
	by the programmable completion facilities (see
	Programmable Completion below).

The workaround used by the bash-completion scripts is to paste words from COMP_WORDS together (in _get_comp_words_by_ref).

If only the NEWS file had mentioned it. :)  
Next: SZEDER Gábor
Message 1 of 2 in “Re: bash 4.0 breaks some completion scripts”
  1. Jonathan NiederDec 2, 2010
  2. SZEDER GáborDec 3, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.