All of lore.kernel.org
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: 601632@bugs.debian.org,
	Peter van der Does <peter@avirtualhome.com>,
	Kevin Ballard <kevin@sb.org>,
	Mathias Lafeldt <misfire@debugon.org>,
	Brian Gernhardt <brian@gernhardtsoftware.com>,
	git@vger.kernel.org
Subject: Re: bash 4.0 breaks some completion scripts
Date: Fri, 3 Dec 2010 01:11:57 +0100	[thread overview]
Message-ID: <20101203001157.GC3577@neumann> (raw)
In-Reply-To: <20101202233848.GA8438@burratino>

Hi,


On Thu, Dec 02, 2010 at 05:38:48PM -0600, Jonathan Nieder wrote:
> 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).

Oh dear, oh dear.  I've just sent a reply to your message on the git
list with basically the same findigs. [1]

> 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. :)  

Actually, the NEWS file does mention it (and Peter noted it right at
the start! [2]):

i.  The programmable completion code now uses the same set of characters as
    readline when breaking the command line into a list of words.

But it's really easy to misinterpret this statement, because there is
and there was a $COMP_WORDBREAKS, so the first thing that
comes to mind is that the set of characters in $COMP_WORDBREAKS is
changed, leaving you puzzled for weeks when you discover that the
set of characters is still the same.


Best,
Gábor


[1] http://marc.info/?l=git&m=129133327312420&w=2
[2] http://thread.gmane.org/gmane.comp.version-control.git/159516/focus=159628

      reply	other threads:[~2010-12-03  0:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20101027235919.GB30490@burratino>
2010-12-02 23:38 ` bash 4.0 breaks some completion scripts Jonathan Nieder
2010-12-03  0:11   ` SZEDER Gábor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101203001157.GC3577@neumann \
    --to=szeder@ira.uka.de \
    --cc=601632@bugs.debian.org \
    --cc=brian@gernhardtsoftware.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=kevin@sb.org \
    --cc=misfire@debugon.org \
    --cc=peter@avirtualhome.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.