2022 Developer Survey is open! Take survey.

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
88 views

Ubuntu's bash does not honor INPUTRC

I'm using INPUTRC to move the .inputrc file away from my home folder. It used to work (like with my GNU bash, version 5.1.4), but in bash version 5.1.16, I found that the INPUTRC is no longer honored. ...
user avatar
  • 485
0 votes
0 answers
25 views

reliable method to find keycodes

I'm trying to setup some key binds in bash and it seems to me that the recommended methods (>read, sed -n l, ctrl+V) of getting the strings that correlate to keypresses aren't giving me correct ...
user avatar
0 votes
0 answers
76 views

How to disable libreadline's bracketed paste mode programmatically

Starting with libreadline version 8.1, the default is to give special treatment to "bracketed paste" operations. This breaks parsing for my program, so I want to disable it. I know that it ...
user avatar
  • 156
1 vote
0 answers
60 views

How to use readline bindings everywhere?

Using OSX I am able to use readline-specific bindings, such as going to the beginning of the line with CTRL+A, everywhere. I recently switched to Linux (specifically NixOS) and I've been missing this ...
user avatar
1 vote
1 answer
100 views

How do you set the colour of the bash tab completion when `colored-completion-prefix` is turned on?

I have colored-completion-prefix set on in my ~/.inputrc file, but when I tab complete, the prefix part which has already been typed is a colour that I do not like. In the bash manual it says: "...
user avatar
  • 924
13 votes
2 answers
1k views

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 ...
user avatar
  • 559
0 votes
0 answers
50 views

Readline does not apply user config specified in INPUTRC variable

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 ...
user avatar
0 votes
1 answer
58 views

CamelCase-aware backward-kill-word in readline

backward-kill-word is a readline action that deletes the previous alphanumeric word. For example, applying this action in the following scenario (▯ indicates the position of the cursor) echo hello-...
user avatar
  • 415
0 votes
0 answers
40 views

"undo" is working in .inputrc but why is redo not

While "undo" is working in .inputrc the redo does not as it is in an .inputrc: # Control-Backspace is "\b": undo # Added to ensure it'd work: "\e[1;3C": redo But not. ...
user avatar
2 votes
1 answer
81 views

bash inputrc will not load

I created ~/.inputrc and cannot see any of its effects at the bash readline. $ bind -f ~/.inputrc does not show error nor load the file. $INPUTRC is unset and if I export INPUTRC=~/.inputrc in ~/....
user avatar
  • 194
4 votes
1 answer
499 views

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 ...
user avatar
  • 165
0 votes
1 answer
73 views

Problems in linux xterm/rxvt/console under SSH after migrating to UTF-8 [duplicate]

I use bash and have been using Latin1 encoding my whole life, since I've always had problems when trying to migrate to the advised UTF-8. I finally gave up, and I am migrating everything to UTF-8. ...
user avatar
0 votes
0 answers
31 views

Pressing the key b repeats the word 'set' indefinitely

So, whenever I press the key b or tap two fingers on my touchpad while on the terminal, the cursor prints the word set indefinitely many times. I didn't have this problem recently, but I do remember ...
user avatar
4 votes
1 answer
248 views

How do I remap Control-w in Bash?

I have read a number of answers to similar questions both in this forum and elsewhere, but I cannot make it work for me. I am trying to remap Ctrl+W to delete the word forward rather than backward. I ...
user avatar
  • 223
2 votes
1 answer
162 views

Use bash builtin `bind` command when starting chroot

I have a chroot and I want the chroot to have its own .inputrc file when it starts, and then run a program. I'm used to starting the chroot with chroot <PATH> <PROGRAM_TO_RUN> so I tried ...
user avatar
  • 745
0 votes
2 answers
719 views

Complete list of options for .inputrc / readline

I always knew you could switch between Vim and Emacs bindings for Bash by modifying .inputrc. I'm now realizing there are actually a few different useful options I've decided to turn on including: ...
user avatar
2 votes
1 answer
237 views

Rebinding reverse-search-history in bash

reverse-search-history is bound to C-r by default. One can type C-r to start the search, and then type C-r again to jump to an earlier match. I have bound reverse-search-history to \er (Alt-r). This ...
user avatar
2 votes
2 answers
138 views

How to bind a key combination to null in .inputrc?

You can bind keys like Ctrl-Left and Ctrl-Right in .inputrc like this: # Ctrl-Left "\033[1;5D": backward-word # Ctrl-Right "\033[1;5C": forward-word How would I bind Ctrl-Up and Ctrl-Down to nothing?...
user avatar
  • 924
1 vote
1 answer
363 views

What Popular Programs Use GNU Readline?

I was reading about key-bindings in Bash. They seem to be based on Emacs but offer the ability to switch to vi based ones. You can do set -o vi in your .bashrc to effect Bash, but I saw there was ...
user avatar
0 votes
1 answer
72 views

Can I set one profile for every server I connect with SSH?

I need to create new VMs in the cloud very often for my job. Every time I connect a new remote server with ssh, I need to set some configs like completion-ignore-case on in my ~/.inputrc manually. ...
user avatar
  • 133
6 votes
2 answers
243 views

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. ...
user avatar
2 votes
2 answers
356 views

Where is actually documented, that "\e" stands for the Alt key in .inputrc

A few days ago I learned, that I can use "\ej": history-search-backward "\ek": history-search-forward for avoiding the arrow keys. Now while that works like a charm and i began to read the bash-docs ...
user avatar
  • 173
1 vote
1 answer
119 views

How do I tell readline to use an updated .inputrc?

I have updated my ~/.inputrc file to test out show-all-if-unmodified, and now want to try it out. How do I use it without logging off and back in?
user avatar
1 vote
1 answer
338 views

Non recursive .inputrc macros

I was looking to bind " to automatically insert a pair and put the cursor in the middle. Theoretically, like this: "\"": "\"\"\C-b" But this would act recursively causing this error message to pop ...
user avatar
  • 501
0 votes
1 answer
1k views

inputrc not working in ubuntu 18 as it used to in 16 and below

I used to create a simple .inputrc in my users directory and add the following: "e[A": history-search-backward "e[B": history-search-forward "e[C": forward-char "e[D": backward-char reload bash ...
user avatar
  • 225
3 votes
2 answers
480 views

Why is my readline / .inputrc configuration being ignored?

I have a configuration line in my .inputrc: set enable-bracketed-paste on # Insert paste as a string rather than possibly running it This is valid when typed at the command line: bind 'set enable-...
user avatar
  • 24.6k
3 votes
1 answer
909 views

Bash's "set -o vi" vs readline's own options?

I know there is, for readline, set editing-mode vi You can put the above option in ~/.inputrc, editing-mode is documented by Readline as editing-mode (emacs) Controls whether readline begins with ...
user avatar
  • 22.4k
0 votes
0 answers
323 views

how to make `.inputrc` keybindings to work on commands that are using `read`?

I have this snippet in my .inputrc to map jj as enter/return. "jj": "\C-M" It works well but not for commands that are using read, for example entering passwords. How can I make this to also work ...
user avatar
  • 406
0 votes
1 answer
1k views

Bash ignores vi-ins/cmd-mode-string options in .inputrc

When I first created my .inputrc (it didn't exist by default), I set vi-ins-mode-string to "+" and vi-cmd-mode-string to ":" to differentiate between modes. I didn't have "(cmd)" or "(ins)" prepended ...
user avatar
0 votes
2 answers
507 views

Use environment variable in .inputrc keybinding

I'd like to add a keybinding to my .inputrc that puts the value of an environment variable, USER, on the command line. I tried all kinds of escaping but the string $USER is written verbatim to the ...
user avatar
29 votes
1 answer
16k views

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 ...
user avatar
10 votes
1 answer
1k views

.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 ...
user avatar
0 votes
2 answers
449 views

Call functions from bashrc in inputrc

I'm on Arch Linux (4.13.11) and in my .bashrc, there's a custom function that finds a file using fzf and then opens that file with the default editor: # Search a file with fzf inside a Tmux pane and ...
user avatar
-1 votes
1 answer
130 views

Readline keymapping C-/ not working

I have the following line in my .inputrc which does not appear to be working: "\C-/": insert-comment When I press C-/ I expect the current line to be prefixed with the comment character (#) and ...
user avatar
3 votes
0 answers
478 views

Bash 4.4 change color vi mode [closed]

I am using +~ $ bash --version GNU bash, version 4.4.0(1)-release (x86_64-unknown-linux-gnu) Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://...
user avatar
  • 315
5 votes
3 answers
2k views

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
user avatar
  • 163
3 votes
1 answer
3k views

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 ...
user avatar
4 votes
2 answers
3k views

How to bind Ctrl+arrows/backspace/del to the Readline commands

I'm trying to make the following bindings in my ~/.inputrc: (Ctrl+Del): kill-word (Ctrl+Backspace): backward-kill-word (Ctrl+forward arrow): forward-word (Ctrl+back arrow): backward-word (Home): ...
user avatar
  • 141
0 votes
1 answer
215 views

Bash/Readline vi line editing mode doesn't work in Screen

I have set -o vi in my ~/.profile, and it works fine on the regular console and under Tmux. But when I run Screen, if I press Escape or ^[, I get a visual bell, the next key I press seems to get eaten ...
user avatar
  • 800
2 votes
0 answers
263 views

inputrc GNU readline vi-insert mode mappings do not seem to take effect

I have set vi-mode in my ~/.inputrc. The command-mode keybinds seem to work fine whereas the insert-mode keybindings do not have any effect at all. Specifically, the following are my insert mode ...
user avatar
1 vote
1 answer
3k views

Make ctrl-backspace different than ctrl-h [duplicate]

I am running Debian Jessie. I am using Xterm, though I would prefer an answer which works in a virtual terminal as well. Here, "backspace" is the key with the backwards arrow, two keys above the "...
user avatar
  • 1,228
3 votes
1 answer
864 views

Readline bindings not working with Control and Shift modifiers

I'm tweaking with GNU Readline's key bindings in Bash. Specifically, I wish to achieve the following mapping effect: Control' ==> 'I' ControlShift' ==> "I" Control` ==> `I` Control[ ==>...
user avatar
  • 789
5 votes
2 answers
652 views

If statement in inputrc

I'm using a central location for my bashrc and source that for all my users like this: GLOBAL_BASHRC="/path/to/global/bashrc" if [ -r "$GLOBAL_BASHRC" -a -f "$GLOBAL_BASHRC" ]; then # Load the ...
user avatar
  • 207
3 votes
1 answer
3k views

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?
user avatar
1 vote
1 answer
250 views

Bash: mapping backward-delete-char to a different key

In bash, is it possible to map backward delete not to physical <Backspace> key but to some other key? I.e., <F18> has the following escape sequence [1;5Q, and I tried adding the following ...
user avatar
  • 190
1 vote
0 answers
410 views

paste clipboard text plus string with .inputrc

I've got in my .inputrc something like "\C-v": "script.sh " I use a link from my clipboard as a parameter for the script, so I type ctrl-v and then paste the link, and then hit enter. So I've seen ...
user avatar
3 votes
1 answer
2k views

Bind Ctrl-\ in inputrc?

I've been futzing around with this and can't seem to get it to work. Using Ctrl+V in the terminal correctly outputs ^\ for this combination so it should be recognizable. As I have Ctrl+\ bound to ...
user avatar
  • 2,145
1 vote
1 answer
2k views

inputrc not loading correctly

I added the following to my ~/.inputrc: set show-all-if-ambiguous on # single tab to start completion help set completion-ignore-case on # completion is case-insensitive $include /etc/inputrc If ...
user avatar
4 votes
2 answers
885 views

bash - ignore case but disallow autocomplete if ambiguous

Recently i face inconvenient when using bash auto complete with ignore case. Let's say i have this directories: [xiaobai@xiaobai test]$ l total 20K 3407873 drwx------. 60 xiaobai xiaobai 4.0K May 25 ...
user avatar
  • 4,458
5 votes
2 answers
2k views

Bind C-i and TAB keys to different commands in terminal applications via .inputrc

For what I have tried, TAB and C-i in .inputrc seems to mean the same thing, whatever I bind to one is bound to the other. I know that originally, it was the same thing and that this behavior is kind ...
user avatar