please do not expand leading tildes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash-completion |
Incomplete
|
Low
|
wonder.mice | ||
bash-completion (Debian) |
Confirmed
|
Unknown
|
Bug Description
From: Morita Sho <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: bash-completion: Please do not expand leading tildes
Date: Mon, 07 Jul 2008 20:41:37 +0900
Package: bash-completion
Version: 20080705
Severity: minor
Tags: patch
Hi,
When bash-completion is not installed, the leading tilde will not be
expanded on completion.
$ ls ~testuser/testfile
/home/testuser/
$ ls ~testuser/
=> ~testuser/testfile
However, when bash-completion is installed, the leading tilde will be
expanded on completion because _expand function performs the tilde
expansion. That is slightly annoying.
$ ls ~testuser/
=> /home/testuser/
IMHO, the tilde expansion in _expand seems needless because compgen
correctly handles leading tildes.
I suggest following patch.
--- bash_completion
+++ bash_completion 2008-07-07 17:28:59.000000000 +0900
@@ -353,7 +353,7 @@
# expand ~username type directory specifications
if [[ "$cur" == \~*/* ]]; then
- eval cur=$cur
+ return
elif [[ "$cur" == \~* ]]; then
cur=${cur#\~}
COMPREPLY=( $( compgen -P '~' -u $cur ) )
Regards,
Changed in bash-completion: | |
assignee: | nobody → dpaleino |
importance: | Undecided → Low |
status: | New → Fix Committed |
Changed in bash-completion: | |
status: | Unknown → Confirmed |
Changed in bash-completion: | |
assignee: | David Paleino (dpaleino) → wonder.mice (wonder-mice) |
I agree with this. bash handles it correctly for me without _expand, and __expand_ tilde_by_ ref. These functions don't have any regard for my expand-tilde option either, they blatantly _dis_regard it.