How can I disable that "Display all possibilities" and --More-- stuff in bash?

In my shell, l + tab completes like:

wim@wim-zenbook:~$ l
Display all 135 possibilities? (y or n)

There's a prompt to answer y or n which is annoying, and it pages through with --More-- which is also annoying. How can we make it just show possibilities without the nags?

Using gnome-terminal on Ubuntu.


I read man pages of bash and was able to get the behaviour I wanted by adding the following lines in the file ~/.inputrc

set completion-query-items 0
set page-completions off

I found that in bash's changelog:

If the rl_completion_query_items is set to a value < 0, readline never asks the user whether or not to view the possible completions.

To set this readline variable use

set completion-query-items [value]

This is an excerpt from man bash:

A variable may be set in the inputrc file (...)

completion-query-items (100) This determines when the user is queried about viewing the number of possible completions generated by the possible-completions command. It may be set to any integer value greater than or equal to zero. If the number of possible completions is greater than or equal to the value of this variable, the user is asked whether or not he wishes to view them; otherwise they are simply listed on the terminal.

As according to the doc you can't set this to a negative value, so I would suggest a very large number instead.