Questions tagged [inputrc]

For questions pertaining to inputrc, the configuration file for the GNU Readline library. Use this tag for questions about Readline customizations or about inputrc syntax.

should be used for questions about the configuration or GNU Readline or about ~/.inputrc syntax.

~/.inputrc is the configuration file for the GNU Readline library which provides command-line editing and history searching capabilities for interactive programs with a command-line interface. See for questions and answer about Readline in general.

Further reading

External links

70 questions
34
votes
1 answer

What's the difference between .bashrc and .inputrc

I am new to the unix system, and find it interesting to create customized functions and configurations in the setting files like .bashrc and .inputrc. However, I don't understand the differences between the two. For example, when I created alias, I…
Counter10000
  • 455
  • 1
  • 4
  • 7
33
votes
3 answers

Execute a readline function without keybinding?

I was just reading the readline man-page and discovered a bunch of great commands I didn't know about. However, several don't have default key bindings. Is there a way to execute the unbound commands from the shell? I'm not asking how to bind the…
erikcw
  • 431
  • 4
  • 4
18
votes
3 answers

How to call a "sub" .inputrc? (Like in .bashrc, where you can "source sub_script.sh")

My ~/.bashrc contains exactly one line: source my_config/my_actual_bashrc.sh Is there an equivalent with .inputrc, so my customizations can be in a separate location, and "called" by ~/.inputrc?
aliteralmind
  • 349
  • 2
  • 10
18
votes
2 answers

Copy and set-mark in Bash as in Emacs?

I would like to be able to copy and paste text in the command line in Bash using the same keyboard bindings that Emacs uses by default (i.e. using C-space for set-mark, M-w to copy text, C-y, M-y to paste it, etc.). The GNU Bash documentation says…
Amelio Vazquez-Reina
  • 40,169
  • 77
  • 197
  • 294
14
votes
1 answer

Delete whole argument in current bash command-line

Using ^W (unix-word-rubout) I can easily delete a single "word" from the current command in my bash shell. However, when dealing with quoted arguments that contain spaces (or unquoted arguments containing backslash-escaped spaces) this doesn't work…
ThiefMaster
  • 2,297
  • 2
  • 23
  • 25
14
votes
2 answers

Can I make the clear command behave like Ctrl-L in Bash?

It seems that clear and bash Ctrl-L are quite different; clear completely removes all previous terminal information (so you cannot scroll up) while Ctrl-L just scrolls the screen so that the cursor is at the top of the page so that you can still…
YorSubs
  • 601
  • 5
  • 13
10
votes
1 answer

.inputrc vs .bashrc settings

I've noticed few settings in .bashrc and .inputrc files look the same or are similar, such as: shopt -s nocaseglob vs set completion-ignore-case export HISTSIZE vs set history-size export HISTFILESIZE vs set history-size Do .inputrc settings also…
one too many
  • 103
  • 5
9
votes
1 answer

tmux option `xterm-keys` does not enable control+arrows

I cannot make tmux recognize Ctrl-Left-arrow sequence differently from just a left arrow, and the same for the right arrow too. In my ~/.inputrc, I have mapped these sequences (as issued by 2 different terminal emulators, namely putty and mobaxterm)…
7
votes
2 answers

Bash displays international characters as escape sequences

When I press certain keys (e.g. German umlauts) in the bash command line, I get escape sequences. For example, ß gives me \303. These escape sequences are treated as single characters, so one backspace deletes the whole sequence. The character is…
jdm
  • 569
  • 5
  • 16
6
votes
1 answer

How to map alt backspace to some command in .inputrc?

Does anyone know how to bind key combinations with Alt in inputrc? I want to map a key combination Alt+Backspace to backward-kill-word, but when I press Ctrl+V and Alt+Backspace to see what characters it represents, it shows ^[ for a brief moment…
a_girl
  • 185
  • 5
6
votes
2 answers

Briefly jump to matching parentheses in Bash

In vim there is an option called showmatch. When you type a closing parenthesis in insert mode, this jumps the cursor to the matching opening parenthesis (at the same nesting level), then back again. This is very useful with languages like prolog…
Myc3lium
  • 69
  • 2
6
votes
1 answer

Make zsh use readline instead of zle?

Is there a way to make zsh use readline reading /etc/inputrc and ~/.inputrc instead of zle module? I keep my command-line key bindings in inputrc to be applied globally to all other "shells" who use it like those of sqlite, mysql etc. I think zsh…
user86041
6
votes
1 answer

How do I properly source .inputrc?

I have several set commands in .inputrc. Previously I've loaded them via source .inputrc, but some programs are unhappy with set commands in .profile. What is the correct way of sourcing it?
Lenar Hoyt
  • 714
  • 2
  • 7
  • 18
6
votes
2 answers

Recover last argument of the last command in bash' vi mode

When using bash's vi mode (set -o vi), is it possible to recover the last argument of the last executed command? This is done in emacs mode with ESC+., and I would like to do it in vi mode as well. I know that bash provides !$ and $_, but they are…
sromero
  • 757
  • 5
  • 11
5
votes
3 answers

unbind default key from inputrc

What I want to do is made C-h not send backwards-delete-char there is nothing about it in my inputrc files but is shows up in bind -p
Samuel
  • 163
  • 6
1
2 3 4 5