Bug 734209

Summary: Weird bash file completion for a file with a ":" at first position
Product: [Fedora] Fedora Reporter: Joachim Backes <joachim.backes>
Component: bashAssignee: Roman Rakus <rrakus>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: maxamillion, rrakus, tsmetana
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-05 09:28:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Joachim Backes 2011-08-29 18:24:49 UTC
Description of problem:
Suppose you have a file called ":1" (touch :1)
Then the command "rm :<tab>" completes to "rm :\:" which is wrong because :1 contains only one colon (not two).

Version-Release number of selected component (if applicable):
bash-4.2.10-4.fc16.x86_64

How reproducible:
always

Steps to Reproduce:
1.See description
2.
3.
  
Actual results:
See description

Expected results:
Completion to "rm :1" or at least to "rm \:1"

Additional info:
1. The F16 behaviour differs from the F15 behaviour.
2. I think it nothing to do with the fact that the bash command ":" does nothing.

Comment 1 Roman Rakus 2011-08-30 13:56:18 UTC
Not a bug. bash's readline have special variable COMP_WORDBREAKS. `:' is considered as word separator.

Comment 2 Joachim Backes 2011-08-30 14:24:23 UTC
echo $COMP_WORDBREAKS 
"'><=;|&(:
unset COMP_WORDBREAKS

 
echo $COMP_WORDBREAKS 

Now ':' is no more a separator!

But still:

'rm :<TAB>' completes to 'rm :\:'

I think, the bug should be reopened!

Comment 3 Roman Rakus 2011-09-05 09:28:01 UTC
(In reply to comment #2)
> echo $COMP_WORDBREAKS 
> "'><=;|&(:
> unset COMP_WORDBREAKS
> 
COMP_WORDBREAKS loses special meaning when unset, see man page
> 
> echo $COMP_WORDBREAKS 
> 
> Now ':' is no more a separator!
> 
> But still:
> 
> 'rm :<TAB>' completes to 'rm :\:'
> 
> I think, the bug should be reopened!

Use something like
COMP_WORDBREAKS=${COMP_WORDBREAKS/:/}