Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 262246 - app-shells/bash-completion-20081219-r1 fails to autocomplete after an escaped character with app-shells/bash-4.0_p10
Summary: app-shells/bash-completion-20081219-r1 fails to autocomplete after an escaped...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal with 1 vote (vote)
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords:
: 262474 263109 267149 (view as bug list)
Depends on:
Blocks: 265504
  Show dependency tree
 
Reported: 2009-03-12 10:29 UTC by Mike Auty (RETIRED)
Modified: 2009-04-27 05:02 UTC (History)
6 users (show)

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


Attachments
patch that (partially) fixes completion with escaped characters in >=app-shells/bash-4.0 (01_escaped_completion.patch,388 bytes, patch)
2009-03-23 01:07 UTC, Alex Alexander (RETIRED)
Details | Diff
ebuild patch for =app-shells/bash-completion-20081219-r1.ebuild that applies above patch if has_version >=app-shells/bash-4.0 (bash-completion-20081219-r2.ebuild.patch,817 bytes, patch)
2009-03-23 01:10 UTC, Alex Alexander (RETIRED)
Details | Diff
patched app-shells/bash-completion ebuild that uses the above patch (bash-completion-20081219-r2.ebuild,3.48 KB, text/plain)
2009-03-23 01:12 UTC, Alex Alexander (RETIRED)
Details
bash-completion-20081219-bash4.patch (bash-completion-20081219-bash4.patch,974 bytes, patch)
2009-03-30 16:38 UTC, Patrick McLean
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Auty (RETIRED) gentoo-dev 2009-03-12 10:29:31 UTC
Hiya guys,

I noticed since I upgraded to bash-4.0_p10 that bash completion on filenames with escaped characters no longer seemed to be working as it used to.  Here's an example:

directory structure: a/b\ c/d\ e/

cd a/<tab> => cd a/b\ c/
cd a/b\ c/<tab><tab> => cd a/b\ c/<beep><beep>
cd a/b\ <tab> => cd a/b\ <beep>
cd a/b<tab> => cd a/b\ c/

So it's clear that it's stopping on the escaped character.  There's exactly the same behaviour with b\(c.  I'm not sure how to go about debugging bash-completion scripts, but in case it's useful here's my shopt output:

autocd         	off
cdable_vars    	off
cdspell        	off
checkhash      	off
checkjobs      	off
checkwinsize   	on
cmdhist        	on
compat31       	off
compat32       	off
dirspell       	off
dotglob        	off
execfail       	off
expand_aliases 	on
extdebug       	off
extglob        	on
extquote       	on
failglob       	off
force_fignore  	on
globstar       	off
gnu_errfmt     	off
histappend     	on
histreedit     	off
histverify     	off
hostcomplete   	off
huponexit      	off
interactive_comments	on
lithist        	off
login_shell    	on
mailwarn       	off
no_empty_cmd_completion	off
nocaseglob     	off
nocasematch    	off
nullglob       	off
progcomp       	on
promptvars     	on
restricted_shell	off
shift_verbose  	off
sourcepath     	on
xpg_echo       	off

I've CCed base-system in case the bash-maintainers have seen anything like this before.  If there's any further information I can provide, or any tests you want me to run, just let me know...  5:)
Comment 1 Alex Alexander (RETIRED) gentoo-dev 2009-03-14 11:25:48 UTC
I'm having the same issue with =bash-4.0_p10 on two boxes.

Tab completion "dies" when it meets an escaped character in a file/dir name.

Downgrading to =bash-3.2_p48-r1 fixes the issue.
Comment 2 Rahul Jain 2009-03-14 21:56:54 UTC
Same problem, autocompletion fails due to the escape character.
Comment 3 Rahul Jain 2009-03-14 21:57:13 UTC
*** Bug 262474 has been marked as a duplicate of this bug. ***
Comment 4 Rahul Jain 2009-03-14 23:55:34 UTC
Same problem with bash-4.0_p10
Comment 5 Rahul Jain 2009-03-14 23:56:04 UTC
My bad with bash-4.0_p10-r1
Comment 6 Mark 2009-03-22 19:52:51 UTC
You can find at least a partial solution to this problem at http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00165.html
Comment 7 Alex Alexander (RETIRED) gentoo-dev 2009-03-23 01:07:04 UTC
Created attachment 185932 [details, diff]
patch that (partially) fixes completion with escaped characters in >=app-shells/bash-4.0

patch taken from http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00165.html
Comment 8 Alex Alexander (RETIRED) gentoo-dev 2009-03-23 01:10:43 UTC
Created attachment 185934 [details, diff]
ebuild patch for =app-shells/bash-completion-20081219-r1.ebuild that applies above patch if has_version >=app-shells/bash-4.0
Comment 9 Alex Alexander (RETIRED) gentoo-dev 2009-03-23 01:12:08 UTC
Created attachment 185935 [details]
patched app-shells/bash-completion ebuild that uses the above patch
Comment 10 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-03-23 01:55:28 UTC
It is not clear to me if this is a bash or bash-completion issue as you have referenced a patch sent to the *bash* mailing list.
Comment 11 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-03-23 01:59:13 UTC
Doh, I should read better. It is solely completion related. I am talking with bash-completion upstream and will have a version bump or patched ebuild soon. thx.

(base-system doesn't need to be on this bug)
Comment 12 Patrick McLean gentoo-dev 2009-03-30 16:38:43 UTC
Created attachment 186772 [details, diff]
bash-completion-20081219-bash4.patch

This patch combines the one previously suggested with one from the redhat bugzilla, this mostly seems to fix the problem.

https://bugzilla.redhat.com/show_bug.cgi?id=490322
Comment 13 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-04-09 04:32:44 UTC
sorry for the delay guys. Some of this has been fixed in v1.0 which should be in the tree within a day
Comment 14 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-04-09 04:53:27 UTC
(In reply to comment #13)
> sorry for the delay guys. Some of this has been fixed in v1.0 which should be
> in the tree within a day
> 

Oh, you will have to "downgrade" to use v1.0. Please fill me in on any problems now. It is hard to determine what is fixed or not. thx.
Comment 15 Tobias Klausmann (RETIRED) gentoo-dev 2009-04-09 10:21:18 UTC
scp-autocompletion is still not working for me: after completing the host (adding a colon), the ssh completion does not complete file names on the remote side but another instance of known_hosts on the local side. If I add a / after the colon, I get completion for local files (starting with /).

versions:
$ eix -Ic bash
[I] app-shells/bash (4.0_p17 2009/04/09/11:58 net nls plugins -afs -bashlogger -examples -vanilla)
[I] app-shells/bash-completion (1.0 2009/04/09/12:15 )
[I] app-shells/gentoo-bashcomp (20090222 2009/03/17/10:49 )
Found 3 matches.
Comment 16 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-04-09 13:02:41 UTC
Ok, I followed all the links and various bug reports and they all lead me to upstream patch:

http://git.debian.org/?p=bash-completion/bash-completion.git;a=commitdiff_plain;h=1421e55aac075e13491cd212b796bdd453214a2c;hp=27daafa76fe1821e5ff3d46f5b64fe8464708084

So, I committed that in 1.0-r1. I don't have bash4 easily available to me here so I will depend on feedback from you guys. Please re-open if needed.
Comment 17 SpanKY gentoo-dev 2009-04-09 23:04:03 UTC
*** Bug 263109 has been marked as a duplicate of this bug. ***
Comment 18 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-04-10 01:42:18 UTC
(In reply to comment #17)
> *** Bug 263109 has been marked as a duplicate of this bug. ***
> 

This means that other people are hitting this issue with bash-4. I have now fixed the upgrade path in bash-completion. v0.* is stable, v1.0* is ~arch. bash-4 users will now get the correct b-c package without fuss.

thx for all the reports and testing, people.
Comment 19 SpanKY gentoo-dev 2009-04-27 05:02:05 UTC
*** Bug 267149 has been marked as a duplicate of this bug. ***