"show-all-if-amset" spam in terminal when pressing "b" key once

I am new to ubuntu and when I recently tried to execute a command in the terminal and pushed the "b" key , it typed "set" and then started to spam "show-all-if-amset".

enter image description here

How can I solve this?

Edit: On second look,it just types "set show-all-if-am", still don't know what it means though...

Edit 2: This happens in the visual code terminal as well.

Edit 3: This seems to be a problem with bash, the same issue doesn't happen with dash or sh.

2 Answers

The input you type for example in a terminal is evaluated by a tool called Readline. Readline has a few dozens variables that can be set to customize its behaviour. One of those variables is show-all-if-ambiguous. The syntax to change the value of show-all-if-ambiguous or another Readline variable would be

set show-all-if-ambiguous on

or

set show-all-if-ambiguous off

respectively. Those settings are meant to go into a config file called .inputrc (note the dot at the start) in your user's home directory.

It looks like a Readline setting was put somewhere where it doesn't belong, and it throws a wrench into things. Maybe you put it somewhere yourself, or a program / tool / script / ... you're using is buggy or not correctly installed.

If you can get a terminal to behave enough to do it, a search for "set show-all-if-ambiguous" over your home directory might get you on the track of the "culprit":

grep -rIl 'set show-all-if-ambiguous' /home/yourusername

You need to replace "yourusername" with your user name, obviously ;)

2

I found the problem, in the .inputrc file I had the following lines:

$include /etc/inputrc
set completion-ignore-case On
bind TAB:menu-complete
bind "set show-all-if-ambiguous on

I don't know why this worked before, but apparently, as specified in this post: I can't type a “b” when I'm in the command line, the word "bind" is not recognised. Removing the bind solved the problem.

Many thanks to Henning Kokerbeck for telling me the problem was with the .inputrc file!

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like