<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">This patch is invalid, please ignore
it. Sorry.<br>
<br>
On 08/23/2012 01:25 AM, wonder.mice wrote:<br>
</div>
<blockquote cite="mid:50354E3E.30701@gmail.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
This patch will check<br>
<blockquote>_rl_enabled expand-tilde<br>
</blockquote>
before calling _expand.<br>
<br>
This will fix issues like that:<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
#489720 [m|U☹|=↝] [bash-completion] bash-completion: Please do
not expand leading tildes<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
#521406 [m|U☹|=↝] [bash-completion] bash-completion: leading
tilde always expanded<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
please do not expand leading tildes <a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="https://bugs.launchpad.net/bash-completion/+bug/324505">https://bugs.launchpad.net/bash-completion/+bug/324505</a><br>
<br>
Also this patch will not break scp and others, like described
here:<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a moz-do-not-send="true"
href="http://lists.alioth.debian.org/pipermail/bash-completion-devel/2009-February/000973.html">http://lists.alioth.debian.org/pipermail/bash-completion-devel/2009-February/000973.html</a><br>
<br>
The same change (replace "_expand || return 0" with "_rl_enabled
expand-tilde && (_expand || return 0)") also must be done
in following files in /etc/bash_completion.d:<br>
<blockquote>bash$ grep -rn " _expand" /etc/bash_completion.d/<br>
/etc/bash_completion.d/<a moz-do-not-send="true"
class="moz-txt-link-freetext" href="info:11">info:11</a>:
_expand || return 0<br>
/etc/bash_completion.d/lrzip:49: _expand || return 0<br>
/etc/bash_completion.d/povray:12: _expand || return 0<br>
/etc/bash_completion.d/<a moz-do-not-send="true"
class="moz-txt-link-freetext" href="man:21">man:21</a>:
_expand || return 0<br>
/etc/bash_completion.d/xz:53: _expand || return 0<br>
/etc/bash_completion.d/lzop:54: _expand || return 0<br>
/etc/bash_completion.d/rsync:12: _expand || return 0<br>
/etc/bash_completion.d/sshfs:11: _expand || return 0<br>
/etc/bash_completion.d/bzip2:37: _expand || return 0<br>
/etc/bash_completion.d/ssh:347: _expand || return 0<br>
/etc/bash_completion.d/lzma:32: _expand || return 0<br>
/etc/bash_completion.d/dd:25: _expand || return 0<br>
/etc/bash_completion.d/gcc:19: _expand || return 0<br>
/etc/bash_completion.d/findutils:70: _expand || return 0<br>
/etc/bash_completion.d/dpkg:29: _expand || return 0<br>
/etc/bash_completion.d/gzip:41: _expand || return 0<br>
</blockquote>
If general idea is OK, I will provide full patch.<br>
<br>
--- /etc/bash_completion.original 2012-08-14 23:08:38.189654426
+0400<br>
+++ /etc/bash_completion 2012-08-23 01:12:13.313643700 +0400<br>
@@ -1596,7 +1596,7 @@<br>
COMPREPLY=()<br>
_get_comp_words_by_ref cur<br>
<br>
- _expand || return 0<br>
+ _rl_enabled expand-tilde && (_expand || return 0)<br>
<br>
# get first exclusion compspec that matches this command<br>
xspec=$( awk "/^complete[ \t]+.*[ \t]${1##*/}([ \t]|\$)/ {
print \$0; exit }" \<br>
</blockquote>
<br>
</body>
</html>