Skip to main content

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
1 vote
0 answers
20 views

How to remap "vi-search-again" in .inputrc?

I use Colemak + Bash Vi mode, and have remapped h j k l to h n e i in .inputrc. The original N n keys for repeating search seem to be bound to the same command: $ # Run in command mode $ bind -p | ...
UM-Li's user avatar
  • 47
0 votes
0 answers
32 views

I can't bind Meta-h to backward-kill-word using bash/readline for my xterms

redhat-release: Red Hat Enterprise Linux Workstation release 7.4 (Maipo) bash version: 4.2.46(2) xterm version: X.Org 7.6.0(295) I'm using xmodmap to map my Meta keys correctly. Confirmed this via ...
eh3's user avatar
  • 1
2 votes
2 answers
199 views

Map Alt-c to Ctrl-u

Im writing the ~/.bashrc file. I want to bind, Alt-c to Ctrl-u. So that when I press Alt-c. The functionality of Ctrl-u should happen. Ctrl-u clears the text on the terminal. So Alt-c should now do ...
john-jones's user avatar
  • 1,736
1 vote
1 answer
193 views

How to map backspace key in inputrc

I want to set the backspace key to the usual backward-delete-char in vi-command mode. In bash, ctrl-v + <backspace> outputs ^?. I've tried the following in my ~/.inputrc file but find that <...
roro's user avatar
  • 125
0 votes
1 answer
117 views

The letter "y" won't print in macOS Terminal [closed]

I'm learning BASH scripting, and I upgraded my BASH to version 5.1 using Homebrew. When I try typing "y", I just get a sound. When I run a script with a letter "y" in it, I get the ...
Jim's user avatar
  • 3
1 vote
0 answers
518 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. ...
xpt's user avatar
  • 1,644
0 votes
0 answers
205 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 ...
Nimrod Weinberg's user avatar
3 votes
1 answer
2k 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 ...
Ethan's user avatar
  • 194
2 votes
0 answers
248 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 ...
Christian's user avatar
2 votes
1 answer
1k 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: "...
paradroid's user avatar
  • 1,203
16 votes
2 answers
8k 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 ...
YorSubs's user avatar
  • 631
0 votes
1 answer
201 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-...
mgarort's user avatar
  • 455
0 votes
0 answers
86 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
313 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 ~/....
Paul's user avatar
  • 210
6 votes
1 answer
1k 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 ...
a_girl's user avatar
  • 185
0 votes
1 answer
129 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. ...
Luis A. Florit's user avatar
0 votes
0 answers
36 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 ...
user431476's user avatar
4 votes
1 answer
509 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 ...
Manngo's user avatar
  • 233
2 votes
1 answer
294 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 ...
Wimateeka's user avatar
  • 1,015
4 votes
2 answers
4k 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: ...
Philip Kirkbride's user avatar
2 votes
1 answer
808 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 ...
Ratha Grimes's user avatar
3 votes
2 answers
284 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?...
paradroid's user avatar
  • 1,203
3 votes
1 answer
773 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 ...
Philip Kirkbride's user avatar
0 votes
1 answer
204 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. ...
Chris Kao's user avatar
  • 133
6 votes
2 answers
433 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. ...
Myc3lium's user avatar
3 votes
2 answers
1k 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 ...
chalybeum's user avatar
  • 183
1 vote
1 answer
333 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?
Felix Dombek's user avatar
1 vote
1 answer
633 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 ...
elig's user avatar
  • 570
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 ...
John's user avatar
  • 235
3 votes
2 answers
731 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-...
Tom Hale's user avatar
  • 31k
4 votes
1 answer
1k 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 ...
Evan Carroll's user avatar
  • 31.6k
0 votes
0 answers
519 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 ...
cevhyruz's user avatar
  • 437
0 votes
1 answer
2k 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 ...
alyms108's user avatar
0 votes
2 answers
674 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 ...
Matthias Braun's user avatar
41 votes
1 answer
28k 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 ...
Counter10000's 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 ...
one too many's user avatar
0 votes
2 answers
638 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 ...
Matthias Braun's user avatar
0 votes
1 answer
240 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 ...
DanielGibbs's user avatar
3 votes
0 answers
558 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://...
A.Dumas's user avatar
  • 435
6 votes
3 answers
3k 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
Samuel's user avatar
  • 173
5 votes
1 answer
4k 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
4k 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): ...
1234ru's user avatar
  • 141
0 votes
1 answer
313 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 ...
Bandrami's user avatar
  • 850
2 votes
0 answers
389 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 ...
Dr Krishnakumar Gopalakrishnan's user avatar
1 vote
1 answer
4k 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 "...
rexroni's user avatar
  • 1,518
4 votes
1 answer
1k 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[ ==>...
Naitree's user avatar
  • 899
5 votes
2 answers
880 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 ...
yzfr1's user avatar
  • 207
6 votes
1 answer
5k 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?
Lenar Hoyt's user avatar
1 vote
1 answer
350 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 ...
A S's user avatar
  • 210
1 vote
0 answers
494 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 ...
strudelkopf's user avatar