Bug 715865

Summary: having bash-completion (1.3-1.3) installed cause sh <tab> my_script to no be auto-completed
Product: [openSUSE] openSUSE 12.1 Reporter: Bruno Friedmann <bruno>
Component: BasesystemAssignee: Forgotten User tCnyPY8iPq <forgotten_tCnyPY8iPq>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Factory   
Target Milestone: ---   
Hardware: All   
OS: SUSE Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Bruno Friedmann 2011-09-03 16:59:24 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20100101 Firefox/6.0 FirePHP/0.4

Once you install bash-completion you loose the possibility to have auto-completion on script that doesn't end with .sh 


Reproducible: Always

Steps to Reproduce:
1. Remove bash-completion if installed 
2. create a simple script by echo "date +%F" > my_test
2. do sh <tab> my_te -> sh my_test is completed on command line 
3. sh my_test return the date 
4. install bash-completion : zypper in bash-completion
5. do sh <tab> my_ = never completed 
6. mv my_test my_test.sh 
7. do sh <tab> my_t -> is completed to my_test.sh 


Actual Results:  
broken feature that have works for years no trace about that in changelog 

* Fri Feb 25 2011 poletti.marco@gmail.com
- Update to version 1.3:
  + Added completions for: badblocks, compgen, crontab, dumpe2fs,
    e2freefrag, e2label, ether-wake, filefrag, gendiff, growisofs,
    hping{,3} (the previous version already completed hping2),
    iftop, ip, iscsiadm, javaws, kid3, lrzip, lsof, mktemp,
    perldoc, portecle, POSIX sh, postgresql,
    sha{,224,256,384,512}sum, sysbench, tune2fs, xfreerdp, xmodmap,
    xm subcommands and xrdb.
  + Improve the completions for: autotools, /etc/init.d/*, ipmitool,
    jar, java, javadoc, MAC address, man, mencoder, mkdir, mplayer,
    okular, pack200, povray, python, rpm, rpmbuild, sqlite3, tar,
    unzip, users/groups (in various contexts), wodim, xine-based
    players and xmllint.
  + Fix the completions for: avahi-browse, IPv6 known hosts,
    kompare, muttrc, p4, povray and ~username (in various
    contexts).
  + Other changes

* Thu Jan 13 2011 vuntz@opensuse.org
- Add bash-completion-fix-service.patch to fix an error created by
  the "service" completion.


Expected Results:  
sh my_test get auto-completed
Comment 1 Forgotten User tCnyPY8iPq 2011-09-04 08:31:31 UTC
Hi.

(Note that I am the packager of bash-completion for openSUSE, not the maintainer of bash-completion)

I can reproduce your issue with bash-completion-1.3 on openSUSE 11.4.

I think the bug is related to the "Add completions for: [..] POSIX sh" item of the changelog.

I have filed a bug in the bash-completion project:
http://alioth.debian.org/tracker/index.php?func=detail&aid=313328&group_id=100114&atid=413095

In the meantime, you can use "bash" instead of "sh". It works for me.
Comment 2 Bruno Friedmann 2011-09-04 09:00:17 UTC
Hi Marco, sure you're not the upstream guy, just the packager :-)

Thanks for the upstream report ... and the trick about bash 
will be a workaround for me until a fix.
Comment 3 Forgotten User tCnyPY8iPq 2011-09-10 14:17:54 UTC
The upstream bug has been closed with this explanation:

"As far as I'm concerned, this is intentional and consistent with other completions. Users can always force bash's default filename completion with Alt+/ if they do not like bash-completion's behavior."

You find the explanation in the above link, and you can comment there if you have something to say about this.

So I should probably close this bug, too. Or shouldn't I?
Comment 4 Bruno Friedmann 2011-09-11 13:35:07 UTC
Ok I understand they want to make linux to look and feel like windows, and now rely on filename extension which look really strange.

The answer about completion with the ALT+/ is really a non-sense with certain keyboard layout. 
for example now I will need to use two hands and use 3 finger to have the previous completion I get with only one hit on tab
to complete then need to relase three touch, then hit the following letter and so one.

I won't call that an enhancement. 
But if upstream this is needed and wanted by users, that fine too afterwards.
Comment 5 Bruno Friedmann 2011-09-11 13:35:46 UTC
I close the bug as resolved as wontfix due to upstream decision.