How can I prevent a space from being added to a tab-filled word using Perl Term :: Readline?

I am using Term :: ReadLine :: Gnu's tab completion support . Every time I do a tab, I get a space after the completed word.

For example:

If I have the word "complete" as a possible completion. After the prompt, I clicked the tab and I get it like:

"complete"

where is the space at the end of the terminated word. I want to:

"to complete"

Is there a way to remove this space?

+2


source to share


1 answer


Try this (untested) in your completion function:

my $attribs = $term->Attribs;
$attribs->{completion_suppress_append} = 1;

      



This corresponds to the variable rl_completion_suppress_append

on the GNU read line.

+7


source







All Articles