Hi,
this bug hit me today, too, when I wanted to delete filenames with
newlines.
Completion for mv, rm and ls (haven't tested others) show this bug, even if
you use M-* (insert-completions).
$ rm fo<M-*>
results even to:
$ rm bar foo
It does not fail on e. g. echo:
$ echo fo<tab>
$ echo 'foo
bar'
(M-* works here correctly, too.)
Interesting point is, that it _only_ seems to break on newlines. Doing
$ touch "$(echo -e 'evil filename with\nan LF and other special chars ($bla) : , "')"
$ rm ev<M-*>
results in:
$ rm an\ LF\ and\ other\ special\ chars\ \(\$bla\)\ \:\ \,\ \" evil\ filename\ with
As a little workaround one can either write
$ echo rm ev<tab>
or
$ xrm ev<tab>
then using C-a or Home and deleting "echo " or "x" before execution. The
last one maybe only works if there isn't a xrm file/function/alias or
something. And oh, I just found out, you can even do
$ rm ev<M-/>
(M-/ is by default bound to complete-filename. M-x BTW can be entered as ESC
x, too.)
Greetings,
Mike