Opened 10 years ago

Closed 10 years ago

#43265 closed defect (fixed)

bash-completion breaks completion of paths starting with ~ with bash @4.3.8

Reported by: xeron (Ivan Larionov) Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: cooljeanius (Eric Gallager)
Port: bash bash-completion

Description

xeron@Xerons-MacBook:~$ echo $BASH_VERSION
4.3.8(1)-release
xeron@Xerons-MacBook:~$ mkdir test
xeron@Xerons-MacBook:~$ mkdir test/1
xeron@Xerons-MacBook:~$ mkdir test/2
xeron@Xerons-MacBook:~$ touch test/file1
xeron@Xerons-MacBook:~$ touch test/testfile2
xeron@Xerons-MacBook:~$ vim ~/test/<TAB><TAB>
1/ 2/ 
xeron@Xerons-MacBook:~$ vim test/<TAB><TAB>
1/         2/         file1      testfile2  
xeron@Xerons-MacBook:~$ /bin/bash
xeron@Xerons-MacBook:~$ echo $BASH_VERSION
3.2.51(1)-release
xeron@Xerons-MacBook:~$ vim ~/test/<TAB><TAB>
1/         2/         file1      testfile2  
xeron@Xerons-MacBook:~$ vim test/<TAB><TAB>
1/         2/         file1      testfile2  

Caused by #43173

Change History (10)

comment:1 Changed 10 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:2 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: raimue@… removed
Owner: changed from macports-tickets@… to raimue@…

comment:3 Changed 10 years ago by raimue (Rainer Müller)

Port: bash-completion added
Status: newassigned

Are you using bash-completion? I can reproduce the bug, but only when bash-completion is loaded.

comment:4 in reply to:  3 Changed 10 years ago by xeron (Ivan Larionov)

Replying to raimue@…:

Are you using bash-completion? I can reproduce the bug, but only when bash-completion is loaded.

Yes I do.

I can confirm, it's reproducible only with bash-completion enabled.

comment:5 Changed 10 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: assignedclosed
Summary: bash 4.3.8 breaks completion of paths started with ~bash-completion breaks completion of paths starting with ~ with bash @4.3.8

Fixes committed in r118693.

Remember to reopen any shells to load the new bash-completion.

comment:6 Changed 10 years ago by xeron (Ivan Larionov)

Works now. Thank you!

comment:7 Changed 10 years ago by heylinus@…

Resolution: fixed
Status: closedreopened

This problem still exists on OS X 10.7.5

$ port version
Version: 2.3.1

$ port installed | grep bash-completion
bash-completion @2.1_8 (active)

"/opt/local/bin/bash" with bash-completion

$ echo $BASH_VERSION
4.3.24(1)-release

$ cd ~/<TAB><TAB> # outputs nothing but error bell sound
$ cd ~/D<TAB><TAB> # outputs nothing but error bell sound

system default "/bin/bash" without bash-completion
or "/opt/local/bin/bash" without bash-completion

$ echo $BASH_VERSION
3.2.48(1)-release # /bin/bash
4.3.24(1)-release # /opt/local/bin/bash

$ cd ~/<TAB><TAB> # outputs list of files and folders under $HOME
$ cd ~/D<TAB><TAB>
Desktop/   Documents/ Downloads/
Last edited 10 years ago by heylinus@… (previous) (diff)

comment:8 Changed 10 years ago by xeron (Ivan Larionov)

Looks like it's a bit different, since in my case it was showing dirs. Also can't reproduce on 10.10.

xeron@Xerons-MacBook:~$ port installed | grep bash-completion
  bash-completion @2.1_8 (active)
xeron@Xerons-MacBook:~$ echo $BASH_VERSION
4.3.24(1)-release
xeron@Xerons-MacBook:~$ cd ~/D
Desktop/   Documents/ Downloads/ Dropbox/   

comment:9 Changed 10 years ago by heylinus@…

Fixed! Please close this ticket.

The problem on my system was caused by a legacy user account created by early version of Macports:

/Users/rabbitmq

Because its home folder were pointed to non-existing folder (/opt/local/var/lib/rabbitmq), when it comes to tilde expansion, it somehow stucks at "~rabbitmq".

Delete the user and group with the same name would fix the problem.

comment:10 Changed 10 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.