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.
59
questions
1
vote
1answer
40 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 ~/....
3
votes
1answer
103 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 ...
0
votes
1answer
21 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. ...
0
votes
0answers
28 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 ...
4
votes
1answer
59 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 ...
0
votes
0answers
16 views
yank-last-arg with numeric argument in vi mode
According to the manual, setting a numeric argument (e.g. Alt-1) and repeatedly invoking Alt-. should keep inserting nth argument from preceding commands. For example, issuing
echo arg1 arg2
echo ...
1
vote
1answer
93 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
...
0
votes
0answers
74 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:
...
1
vote
1answer
94 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 ...
2
votes
2answers
84 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?...
0
votes
1answer
152 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 ...
0
votes
1answer
53 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.
...
6
votes
2answers
146 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. ...
2
votes
2answers
131 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 ...
1
vote
1answer
50 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?
1
vote
1answer
153 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 ...
0
votes
1answer
735 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
...
1
vote
2answers
291 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-...
3
votes
1answer
658 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 ...
0
votes
0answers
239 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 ...
0
votes
1answer
771 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 ...
0
votes
2answers
316 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 ...
17
votes
1answer
10k 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 ...
9
votes
1answer
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 ...
0
votes
2answers
329 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 ...
-1
votes
1answer
95 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 ...
3
votes
0answers
434 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://...
5
votes
2answers
1k 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
0
votes
1answer
2k 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 ...
3
votes
2answers
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): ...
0
votes
1answer
163 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 ...
2
votes
0answers
197 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 ...
1
vote
1answer
2k 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 "...
3
votes
1answer
738 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[ ==>...
4
votes
2answers
471 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 ...
3
votes
1answer
2k 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?
1
vote
1answer
209 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 ...
1
vote
0answers
356 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 ...
3
votes
1answer
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 ...
1
vote
1answer
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 ...
4
votes
2answers
757 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 ...
5
votes
1answer
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 ...
7
votes
2answers
1k views
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 ...
2
votes
1answer
151 views
using shortcuts to move in bash command line [duplicate]
When I use Ctrl+Left_arrow or Ctrl+Right_arrow in bash, I move backward a "word" and forward a "word" respectively. I belive, this is defined in /etc/inputrc
# mappings for Ctrl-left-arrow and Ctrl-...
7
votes
1answer
4k views
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 ...
6
votes
2answers
909 views
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 ...
3
votes
2answers
2k views
bash - wrong key sequence bindings with control+alt+space
I am trying to install some key sequence bindings but I have trouble.
My shell is bash, my terminal is gnome-terminal, and my system is Ubuntu 14.04 in graphic mode.
Edit : my keyboard is french ...
17
votes
3answers
2k views
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?
2
votes
1answer
612 views
Why is “bind ~/.inputrc” causing my up-right slash key ('/') to be disabled until I re-login?
Below is my .inputrc file. Why, after calling bind ~/.inputrc, is my up-right slash key disabled, until I logout and login again?
# Key-bindings for the command-line editor.
# Ask before displaying &...
5
votes
1answer
540 views
Assign both menu-complete and dynamic-complete-history to TAB
Is there a way for me to assign both menu-complete and dynamic-complete-history to Tab (or one to Tab and the other to Tab-Tab) in .inputrc?
I'm thinking there might be a way to setup a function and ...