0

(WSL with Ubuntu 18.04)

I have some configuration settings that I have used before and that can be seen recommended in various places across the internet (not to mention on SO). I hav placed them in a .inputrc file in my home location.

$include /etc/inputrc

# better tab completion
bind "set show-all-if-ambiguous on"
bind "set completion-ignore-case on"

# disable bell
bind "set bell-style none"

# make tab completion treat links as directories
# i.e. adds trailing slash when <tab>-ing
set mark-symlinked-directories on

I'm not clear on why bind is used or not used for these. Internet says bind is used for the readline library. Internet also says .inputrc is for the readline. So they should work together, right?

But when I use these crazy things start to happen in buy terminal (WSL).

In one case (disabling the bell) anytime I type more than N letters at the prompt, bash starts spitting out set over and over without end.

shell printing set over and over

In another case (the tab completion) it spits out "set completion-ignore-case on" after every character I type.

shell printing configuration setting after a character

The odd behaviour stops if I remove the bind and quotes, so I do not need to know how to stop this behaviour. I would like to understand why this happens. Anyone know what's going on here?

Toby
  • 145
  • 1
  • 7
  • 2
    Wy do you have bind there at all? It looks like a series of set commands just like the very last line. – Kusalananda Feb 04 '20 at 14:14
  • @Kusalananda copy-pasta from SO. Honestly I do not know bash or readline very well. bind is a readline command and inputrc is a readline config file, so why would it not be used there? – Toby Feb 04 '20 at 14:23
  • Ah reading new text seems to provide some clarity "bindis a bash builtin for readline" (emphasis mine). I see the problem now, d'oh! – Toby Feb 04 '20 at 14:25
  • 1
    This will be https://unix.stackexchange.com/a/477511/5132 again. – JdeBP Feb 04 '20 at 16:30

1 Answers1

1

Thanks to the comment from @Kusalanada the light dawned with me that bindis the bash builtin for readline. As .inputrc is readline config, it doesn't need or know about bash builtins.

This is why bind was needed in, say, .bashrc, but not in .inputrc.

Toby
  • 145
  • 1
  • 7