[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash-4.0 filename completion
From: |
Krzysiek Pawlik |
Subject: |
Re: bash-4.0 filename completion |
Date: |
Sat, 21 Mar 2009 01:20:42 +0000 |
User-agent: |
Thunderbird 2.0.0.21 (X11/20090319) |
Chet Ramey wrote:
> This might be the result of changes to the bash readline support function
> that dequotes filenames. That function was changed as the result of bug
> reports against bash-3.2 to better implement shell quoting. That means:
>
> 1. Backslashes should not be stripped within single quotes.
>
> 2. Backslashes should only be stripped within double quotes if they're
> followed by one of $ ` " \ <newline>
>
> This affects the behavior of the quote_readline function (or the contexts
> in which it should be called) and the behavior of compgen when it receives
> arguments with quotes. In this case, it looks like the backslash is
> preserved since compgen gets an argument with explicit single quotes.
Attached patch removes escaping of \ -- that seems to solve the simple case of
`cat a\ <TAB>', but doesn't help when file name to complete is in single quotes.
--
Krzysiek Pawlik <nelchael at gentoo.org> key id: 0xBC555551
desktop-misc, java, apache, ppc, vim, kernel, python...
--- base.orig 2009-03-21 01:12:35.000000000 +0000
+++ base 2009-03-21 01:12:55.000000000 +0000
@@ -127,8 +127,7 @@
# results in the original argument
quote_readline()
{
- local t="${1//\\/\\\\}"
- echo \'${t//\'/\'\\\'\'}\' #'# Help vim syntax highlighting
+ echo \'${1//\'/\'\\\'\'}\' #'# Help vim syntax highlighting
}
# This function shell-dequotes the argument
signature.asc
Description: OpenPGP digital signature