Subject: | TAB completion for dir/filenames inserts extra space before done |
When using Term::ReadLine::Perl with re.pl and
doing TAB completion of file and directory
names results in a space being inserted following
a successful directory completion (even if the
directory has possible files or directories
within).
The hoped-for (preferred) behavior is demonstrated
by using Term::ReadLine::Gnu for the readline implementation
as illustrated here.
bash$ ls -R test # list the example directory
test:
a/ b/ c/
test/a:
test/b:
test/c:
bash$ PERL_RL=Perl re.pl
$ test/<TAB> # yields this...
$ test/ |
# where the cursor is at the bar and a
# space character has been inserted after
# the top level directory name
bash$ PERL_RL=Gnu re.pl
$ test<TAB> # yields this...
$ test/
$ test/<TAB><TAB> # yields this
a/ b/ c/
In order to use the path completion with the Perl
readline you have to delete by hand the extra space
before getting the further completions.
Another related point: the list of possible completions
for a directory with Term::ReadLine::Perl lists the
full path so far prepended to the list of directory
entries. This can lead to problems with interactive
display for deep directories with long pathnames.