Bug 734209 - Weird bash file completion for a file with a ":" at first position
Summary: Weird bash file completion for a file with a ":" at first position
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Roman Rakus
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-29 18:24 UTC by Joachim Backes
Modified: 2014-01-13 00:13 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-05 09:28:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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/:/}


Note You need to log in before you can comment on or make changes to this bug.