5

I am trying to change the location of my inputrc. The docs say that it reads the config location from the INPUTRC environment variable

Readline is customized by putting commands in an initialization file (the inputrc file). The name of this file is taken from the value of the INPUTRC environment variable

I exported this variable in my ~/.bash_profile

export INPUTRC="~/.config/readline/inputrc"

and added the following lines to ~/.config/readline/inputrc

$include /etc/inputrc

# Case insensitive tab completion
set completion-ignore-case on

# Single tab partially completes and shows all options
set show-all-if-ambiguous on

# shift + arrows to go back and forth one word at a time
"\e[1;2D": backward-word
"\e[1;2C": forward-word

# Cycle through completions inline 
Tab: menu-complete
"\e[Z": menu-complete-backward

Now if i try to open a new bash session, none of these options seem to have taken effect. It works as expected if I put them in ~/.inputrc with or without the INPUTRC variable exported. I've also tried exporting it from ~/.bashrc and ~/.profile, neither has worked.

I could add these lines to my bashrc using bind but that would mean that other programs that use readline wouldn't share these options.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
tyagdit
  • 138
  • 5
  • 1
    Change `~/` to `"$HOME"` or don't quote the `~/` in the assignment. – Jetchisel Oct 06 '21 at 06:58
  • 1
    I tried doing both, also tried putting the absolute path to the file, still hasn't worked – tyagdit Oct 06 '21 at 07:09
  • 1
    I was hoping you could `$include $HOME/.config/readline/inputrc` in your `.inputrc` but I can't seem to get that to work either /-: – tripleee Oct 06 '21 at 07:46
  • 2
    @tripleee `$HOME` doesn't work in `.inputrc`. With an absolute path it works fine here. – oguz ismail Oct 06 '21 at 09:27
  • It's a good idea but I'm trying to adhere to the XDG directory specs and keep my $HOME clean so this would be a last resort – tyagdit Oct 06 '21 at 10:47
  • I tried in a Docker image with an absolute path and it didn't work, but I was probably overlooking something. Thanks for following up. – tripleee Oct 06 '21 at 11:57

0 Answers0